in reply to Capturing occurrence counts via tr/// with variable interpolation
Use $ans = @{[ $str =~ m/$SrchStr/g ]}; and forget about using eval.
Your $SrchStr, say, if want to find occurances of 'a' and 'z', should be "[az]".
Your $SrchStr, say, if want to find occurances of 'a' and 'z', should be "[az]".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Capturing occurrence counts via tr/// with variable interpolation
by Roy Johnson (Monsignor) on Aug 15, 2005 at 14:03 UTC |
In Section
Seekers of Perl Wisdom