bluethundr has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; @ARGV = reverse @ARGV; while (<>) { chomp; print "\n@_\n"; }
I get perl complaining of "readline() on unopened file at ./tac.pl line 7."when I tried that solution. This seems simple, but in practice I am stumped. I'd appreciate the help of a more powerful monk.#!/usr/bin/perl -w my $in; @ARGV = ( reverse @ARGV); foreach my $x (@ARGV){ @in = <$x>; @in = reverse @in; } while (@in) { chomp; print "\n$_\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Llama ./tac stumper
by davido (Cardinal) on Jun 07, 2004 at 03:39 UTC | |
by BUU (Prior) on Jun 07, 2004 at 05:21 UTC | |
by davido (Cardinal) on Jun 07, 2004 at 06:23 UTC | |
by BUU (Prior) on Jun 07, 2004 at 06:37 UTC | |
by davido (Cardinal) on Jun 07, 2004 at 06:59 UTC | |
|
Re: Llama ./tac stumper (GOLF)
by BrowserUk (Patriarch) on Jun 07, 2004 at 05:18 UTC | |
by tilly (Archbishop) on Jun 07, 2004 at 05:41 UTC | |
by BrowserUk (Patriarch) on Jun 07, 2004 at 06:58 UTC | |
|
Re: Llama ./tac stumper
by ggg (Scribe) on Jun 07, 2004 at 14:15 UTC |