MinniePerl
Technical User
I'm bringing data in and substituting all s with xx. That works. How do I count the number of matches made and print that number?
@matches=....
$howMany=@matches
print $howMany
Am i going the right direction? Where is this inserted in my program? Thanks in advance for any help. Especially stillflame.
open (OLDFILE, "<a:\\program1.txt" #retrieve data
@databack=<OLDFILE>; #assigns to array
close(OLDFILE); #closes
foreach (@databack)
{ #creates foreach loop, so each array is split
#and subs are made
($item, $itemprice, $itemnumber, $totalprice)=(/, /,); #splits data
s/s/xx/ig; #subs all s with xx
}
print @databack;
<STDIN>;
@matches=....
$howMany=@matches
print $howMany
Am i going the right direction? Where is this inserted in my program? Thanks in advance for any help. Especially stillflame.
open (OLDFILE, "<a:\\program1.txt" #retrieve data
@databack=<OLDFILE>; #assigns to array
close(OLDFILE); #closes
foreach (@databack)
{ #creates foreach loop, so each array is split
#and subs are made
($item, $itemprice, $itemnumber, $totalprice)=(/, /,); #splits data
s/s/xx/ig; #subs all s with xx
}
print @databack;
<STDIN>;