in reply to Re: Need a better way to count input lines
in thread Need a better way to count input lines
Ahh! The lights come on! (Then they go dim again) I changed the
But I am perplexed about the split itself. I replaced the (",") with (",\s*") and got the error:
to$fname =~ s/^\s+(.+?)\W*$/$1/;
and the problem went away. (Of course it did. I should have seen that.) I can see why with the '+' it didn't work right, but why would the failure manifest as a CR at the end of $fname?$fname =~ s/^\s*(.+?)\W*$/$1/;
But I am perplexed about the split itself. I replaced the (",") with (",\s*") and got the error:
The paren/quote format worked fine with just a comma but broke with the addition of the space char class. Did I just get lucky the first way?Unrecognized escape \s passed through at phonelist.pl line 28.
As to the LIMIT option, my Llama book doesn't explain it. Does the 2 relate the expectation of having two char within the match?
-Theo-
(so many nodes and so little time ... )
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Need a better way to count input lines
by hv (Prior) on May 07, 2004 at 20:09 UTC |
In Section
Seekers of Perl Wisdom