in reply to grep confusion

The consensus is valid. The code is correct, and I should have cleaned up the records before storing them. For the life of me I don't know why I didn't realize this. You all, once again, have shown me the light. Thank you.

BTW,

$rec =~ s/\W+$//;

Just above shows how I snipped of the arbitrary data at the end of each record.

Thanks again. :-)

Replies are listed 'Best First'.
Re^2: grep confusion
by Hue-Bond (Priest) on Oct 02, 2005 at 18:51 UTC

    Keep in mind that if there's a \w character in the middle of the binary data, that won't work:

    $ perl|od -tx1 my $c=65.66.20.21.67.23.25.10; $c =~ s/\W+$//; print "$c\n"; __OUTPUT__ 0000000 41 42 14 15 43 0a 0000006

    Note that the two bytes (14 and 15) between "B" (42) and "C" (43) are still there.

    --
    David Serrano