Use
Code:
perl -0777 -pe


The problem is -pe is going to go line-by-line, and "lines" are terminated by, well, newlines. The specifics of how the -0 command-line option work are rather arcane (unsurprising when dealing with Perl) but the net effect is you eat the whole file before trying to match.

Alternatively, setting
Code:
$/=undef;

before your pattern matching code will have the same effect (setting the record separator to consume the whole input stream.)


Edited by tonyc (14/09/2011 15:38)
_________________________
- Tony C
my empeg stuff