in reply to Regular expressions....

You don't need regular expressions (except maybe to throw away the header lines).
$/='.'; # Records are terminated by dots my $lnum = 0; while (<>) { tr/\n//d; # Get rid of any embedded newlines ++$lnum; print "$_ --->>> record $lnum\n"; }

We're not really tightening our belts, it just feels that way because we're getting fatter.

Replies are listed 'Best First'.
Re^2: Regular expressions....
by graff (Chancellor) on Jul 13, 2004 at 02:04 UTC
    tr/\n//d; # Get rid of any embedded newlines
    You should really replace "\n" with a plain space character, so you don't get words like "isa" when you want "is a".