DormanResearch : PerlHints?

Referers: HelpfulHints :: (Remote :: Orphans :: Tree )

Dorman Wiki
Dorman Lab Wiki
This is an old revision of PerlHints from 2008-10-27 12:26:39.
PerlCountMatchesInString?: my $cnt = ($str =~ tr/p/p/); # counts the number of times p is found in string
PerlSumArray?: my $cnt = 0; ($cnt+=$_) @array;
PerlCountMatchesInArray?: my $cnt = scalar( grep {/p/} @array); # counts the number of times p is found in array
PerlIndexOfMaxElementInArray?: my $idx=0; $data[$idx] > $data[$_] or $idx = $_ for 1..$#data;
There is no comment on this page. [Display comments/form]