On Jul 23, KEVIN ZEMBOWER said:

>Jeff and John, thanks for your help. I'm invoking my script with a
>command line loop: perl -n pop2html.pl 2001-07-16.txt
>
>The file pop2html.pl, incorporating your suggestion, is:
>if (! /[a-z]/) {chomp; print "<h4>$_</h4>\n"; next;}
>if (/^\s*$/) { print "<br>\n"; next;}
>
>The output of the program is:
><h4>WOMEN'S HEALTH</h4>
><h4></h4>

Well, you should re-arrange your order of tests!  If the string is made up
of ONLY whitespace (like your second test, /^\s*$/, checks), then it
ALREADY matches the !/[a-z]/ test.  Re-arrange them.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to