open (INFILE, $infile) || die "but... $!"; open (OUTFILE, ">$outfile") || die "but... $!"; my @hold; while(<INFILE>){ if ($. < 12){ push @hold, $_; next; } if ($. == 12){ # grab some data from the 12th line # perform some funky manipulation on it print OUTFILE "new funky data from 12th line"; print OUTFILE @hold; next; } print OUTFILE $_; }
see perlman:perlvar
TIMTOWTDI :)
--
my $chainsaw = 'Perl';
In reply to Re: Text Processing
by greenFox
in thread Text Processing
by Ixandantilus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |