You may or may not know about this little (hopefully largely unused) idiom:
Since we don't use global variables anymore (right?), this is no longer useful. But wouldn't it be cool if that could work with lexicals? I offer no solution. Just the thought.
open 0
has been sighted in programs that print themselves.
But if you want to start some interesting discussion, you should post this on P5P.open 0;print<0>
Re:*0
pudge on 2003-06-30T20:44:28
Yes, but that is the same old global.
And what, interesting discussions don't happen on use Perl?:-) I don't want this to be taken too seriously so don't want to contribute to p5p noise. Re:*0
rafael on 2003-06-30T20:49:00
I didn't say "interesting", I said "<i>interesting</i>". With an "i" like in "irony".Re:*0
jamiemccarthy on 2003-07-01T02:51:07
So that's why my films keep ending up with snarky and cynical subtexts: I'm using iMovie.
Here's one shot at it:
perl -e 'my $file = ".bashrc"; open( *FILE = \$file ); print <FILE>'
It even works with strict and warnings. It doesn't work with the flags -ew
, though, which should tell you something. (-we
works.)