Hunter Marshall wrote: > [EMAIL PROTECTED]:/tmp > -> od -x junk > 0000000 6968 0a0a 0a0a 0a0a 000a > 0000011 > [EMAIL PROTECTED]:/tmp > -> perl -n -e 'print "yup\n" if /\x0a/;' junk > yup > yup > yup > yup > yup > yup > yup > [EMAIL PROTECTED]:/tmp > -> perl -n -e 'print "yup\n" if /\x0a\x0a/;' junk
This one-liner is the same as the following script: #!/usr/bin/perl while(<>) { if (/\x0a\x0a/) { print "yup\n"; } } Every iteration of the while loop, the next line from the file opened by <> ('junk' in your case) is stored into the default variable $_. Since a single line will only ever have one \x0a in it, the if statement will never be true. Matthew