in reply to using a variable as a filehandle

Is there a reason you are unable to write the file-in-memory to a temporary file-on-disk, then read that back in? Something like:

open my $TEMPF, '>', 'tempfile.tmp' or die("Unable to write to tempfil +e"); print $TEMPF $file_contents; close $TEMPF; open my $TEMPF, '<', 'tempfile.tmp' or die("Can't read tempfile back i +n"); while (chomp (my $line = <$TEMPF>)) { next unless $line =~ /^06/; #skip unneeded lines chomp(my $line2 = <$TEMPF>); #process lines } close $TEMPF; unlink('tempfile.tmp');
radiantmatrix
require General::Disclaimer;
"Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy