Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'not natural perl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
not natural perl
Authored by: merlyn on Feb 04, '03 12:27:15PM
for(my $i = 0; $i < @history; $i++) {
if($history[$i] =~ /.*bogus.*/) {
}
else {
print OUTFILE $history[$i];
}
}
should be replaced by
print OUTFILE grep !/bogus/, @history;
which is much more natural Perl.

[Editor's note: I cleaned up the HTML that Geeklog killed ... soon, now, that won't be a problem (Geeklog 1.3.7 is much better at it).]

[ Reply to This | # ]