in reply to Re: Re: Simple Encryption question
in thread Simple Encryption question
If your header and trailer look similar to the rest of the data, and if your file is small, you could read everything in to memory first...while (<$filehandle>) { tr/blah/blah/ if /^\d{16}/; # do the translation print; # output result }
Otherwise it will get a bit messy.my @data = <$filehandle>; print $data[0]; # print first line for (1..$#data-1) { # skip first and last line $data[$_] =~ tr/blah/blah; print $data[$_]; } print $data[-1]; # print last line
|
|---|