in reply to Simple regexp question
Hi droog114, Try this,
TIMTOWTDI
use strict; use warnings; open(FILE, shift) || die($!); while(<FILE>){ my $hah = $_ =~ s/\#/$&/g; my $ast = $_ =~ s/\*/$&/g; print '*' x 70, "\nLine No. $.\n",'*' x 70, "\n"; $hah = 0 if (!($hah)); $ast = 0 if (!($ast)); print "Number of #'s\t$hah\n"; print "Number of *'s\t$ast\n"; } close(FILE);
You should view this How (Not) To Ask A Question
Regards,
Velusamy R.
eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Simple regexp question
by SamCG (Hermit) on Mar 31, 2006 at 18:17 UTC |
In Section
Seekers of Perl Wisdom