in reply to how to read & search in a binary file

Your "lines" may match more than one value - and you're only seeing at the first. Change your while to:

while(<>) { print "$1\n" for /(\/$pathchrs*$target$path*)/og }
Or, maybe get rid of the "o" modifier:
my $pathre = qr/\/$pathchrs*$target$path*/; while(<>) { print "$1\n" for /($pathre)/g; }
The problem is that your binary "glop" probably doesn't have any \n's in it for perl to treat as a new line.

Of course, you're not entirely explicit with what you do get, so I'm just guessing.

Replies are listed 'Best First'.
Re^2: how to read & search in a binary file
by perl-diddler (Chaplain) on Jan 30, 2007 at 07:17 UTC
    I think the lack of the line feed was messing me up 'conceptually'. I tried several variations on the pattern, and figured out it was my pattern having \A & \z anchoring it -- when my pathname wasn't really anchored to anything other than unprintables on either end. Sigh.

    I didn't include ":\" in my path chars since I wanted to match the *nix style paths, not the dos paths.

    Oh well...

    Thanks for the hints -- they helped me flesh out what worked from what didn't...