in reply to A another tr/// statement question..
in thread tr/// statement

Hi,
I'd write the whole thing as:
@letter = qw/a b c w x y/; foreach $x (@letter) { $m = 0; open(DATA,"data.txt") or die "couldn't open data\n$!"; while (<DATA>) { $m += ($_ =~ s/$x/$x/g); } close(DATA); print "count $x = $m\n"; }
(note the use of foreach, or and $! ...)

Regards... Stefan

Replies are listed 'Best First'.
Re: Re: A another tr/// statement question..
by supernewbie (Beadle) on Jul 19, 2001 at 16:46 UTC
    Thank you very much Stefan!