in reply to TIMTOWTDI Challenge: Open a file
Here's one:
unshift @ARGV, $rfile; while( <> ) { # .... }
Or how about this:
use Tie::File; tie my @array, 'Tie::File', $rfile or die;
Here's another variation on the @ARGV theme...
#!/usr/bin/perl -p BEGIN{ $rfile = 'myfile.txt'; unshift @ARGV, $rfile; }
Update:
By the way, I won't attempt to justify any of these abominations other than to state the obvious; they're just for fun.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TIMTOWTDI Challenge: Open a file
by apotheon (Deacon) on Apr 19, 2006 at 06:24 UTC |