Skip to content

Commit

Permalink
Best Practice: s/foreach /for /
Browse files Browse the repository at this point in the history
  • Loading branch information
markstos committed Dec 26, 2010
1 parent 8f4e8ec commit 6c8a726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/CGI/Cookie.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sub fetch {
my($key,$value);

my @pairs = split("[;,] ?",$raw_cookie);
foreach (@pairs) {
for (@pairs) {
s/\s*(.*?)\s*/$1/;
if (/^([^=]+)=(.*)/) {
$key = $1;
Expand Down Expand Up @@ -96,7 +96,7 @@ sub parse {
my %results;

my @pairs = split("[;,] ?",$raw_cookie);
foreach (@pairs) {
for (@pairs) {
s/\s*(.*?)\s*/$1/;
my($key,$value) = split("=",$_,2);

Expand Down Expand Up @@ -466,7 +466,7 @@ returned by the browser. The keys of the array are the cookie names. You
can iterate through the cookies this way:
%cookies = fetch CGI::Cookie;
foreach (keys %cookies) {
for (keys %cookies) {
do_something($cookies{$_});
}
Expand Down

0 comments on commit 6c8a726

Please sign in to comment.