DormanResearch : PerlHints?

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

Dorman Wiki
Dorman Lab Wiki
This is an old revision of PerlHints from 2009-06-25 21:23:18.
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;
PerlEnvironmentalVariables?: %ENV, for example $ENV{'HOME'}
PerlHashSlice?: @hash{@array}
There is no comment on this page. [Display comments/form]