in reply to Auto-dailies
these lines:
if ($aolstats =~ /(\d+),(\d+)/) { $aolstats = $1 . $2; } if ($msnstats =~ /(\d+),(\d+)/) { $msnstats = $1 . $2; } if ($wwwstats =~ /(\d+),(\d+)/) { $wwwstats = $1 . $2; }
could be simplified as:
$aolstats =~ s/(\d+),(\d+)/$1$2/; $msnstats =~ s/(\d+),(\d+)/$1$2/; $wwwstats =~ s/(\d+),(\d+)/$1$2/;
or even:
s/(\d+),(\d+)/$1$2/ for ($aolstats,$msnstats,$wwwstats);
and of course, if you are dealing with numbers like 1,000,000, you'll want to add a 'g' flag to the substitution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Auto-dailies
by blakem (Monsignor) on Aug 22, 2002 at 16:15 UTC |