[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] perl regex problem



I am a long time debian and perl user. But obviously long enough!
Forgive the slight misuse of the list, but can anyone shed light
on what I'm doing wrong in this attempt to find \n\n in a text file 
with perl? I'm sure I've done this before.

Thanks

	hunter

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

hhm@hmarshall:/tmp
-> cat junk 
hi






hhm@hmarshall:/tmp
-> od -x junk 
0000000 6968 0a0a 0a0a 0a0a 000a
0000011
hhm@hmarshall:/tmp
-> perl -n -e 'print "yup\n" if /\x0a/;' junk
yup
yup
yup
yup
yup
yup
yup
hhm@hmarshall:/tmp
-> perl -n -e 'print "yup\n" if /\x0a\x0a/;' junk
hhm@hmarshall:/tmp
-> dpkg -l | grep perl\-
ii  perl-5.005     5.005.03-7.1   Larry Wall's Practical Extracting and Report
ii  perl-5.005-bas 5.005.03-7.1   The Pathologically Eclectic Rubbish Lister
ii  perl-5.005-doc 5.005.03-7.1   Man pages and pod docs for Perl
ii  perl-base      5.004.05-1.1   Fake package assuring that one of the -base 
hhm@hmarshall:/tmp
-> perl -v

This is perl, version 5.005_03 built for i386-linux

Copyright 1987-1999, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

hhm@hmarshall:/tmp
-> exit
exit

Process shell finished



Reply to: