in reply to Grade me! TAC

Why are you using a temporary file at all? Couldn't you just read backward from each file and print to STDOUT?

something like

for my $file (reverse @ARGV) { read_backward_and_print($file); }

Why do you need 2 arguments? I'd guess you might want to reverse a single file too...

I'd write your check as:

die "Usage: $0 FILENAMES\n" unless @ARGV >= 2;

Also, I was under the impression that tac was supposed to print the lines in the files in reverse order, NOT to also print the reverse of each line...

Replies are listed 'Best First'.
Re^2: Grade me! TAC
by Frank_Zappa_lives (Initiate) on Jun 11, 2004 at 14:19 UTC
    temporary file? It kind of grew that way. I can see I dont need it now. 2 args? well i just thought there is no concatenattion then reverse of each line? well, not a lot different. :-)