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