Reverse file in Perl
6 febbraio 2010
Nessun commento
#!/usr/bin/perl -w
use strict;
use warnings;
open FILE, "<".$ARGV[0];
my @LINES = <FILE>;
for(my $i = scalar(@LINES) - 1; $i >= 0; $i--)
{
print $LINES[$i];
}
#!/usr/bin/perl -w
use strict;
use warnings;
open FILE, "<".$ARGV[0];
my @LINES = <FILE>;
for(my $i = scalar(@LINES) - 1; $i >= 0; $i--)
{
print $LINES[$i];
}