Hi,
Hello,
I have the following code in a script I'm writing:
foreach my $line (<INN>) { if ( 10 == ($line =~ s/,/,/g) ) { print OUT $line; } }
Is this poor style? It looks a bit ugly, but I can't figure out a better way to do it. I'm sure there is :) The script will be reused and probably maintained by someone else. Is there a more "standard" way of doing this?
That is a Frequently Asked Question.
perldoc -q "How can I count the number of occurrences of a substring within a string"
John -- use Perl; program fulfillment
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>