The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 03-18-2008
era
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
The problem is that with perl -p, you are only reading and examining a line at a time. Thus the pattern match is not being applied to anything which straddles a line boundary, even if you have the /s modifier. You can fix that by reading all lines at once, with perl -0777 or something equivalent.

See also the Perl FAQ, which has a detailed discussion of this topic.