in reply to Re^3: Inline substitution regex
in thread Inline substitution regex
Just guessing, shouldn't the solution be:
foreach (keys %{$ref_cookie}) { push @{$self->{cookies}}, /^-(.*)/, $ref_cookie->{$1}); }
?
Or the curly brackets from the failing original code isolate $_ and the substitution does not affect the last parameter of push?
# push(@{$self->{cookies}}, {$_=~s/^-//}, $ref_cookie->{$_}});
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Inline substitution regex
by ikegami (Patriarch) on Sep 29, 2009 at 16:31 UTC | |
by vitoco (Hermit) on Sep 29, 2009 at 18:20 UTC | |
by ikegami (Patriarch) on Sep 29, 2009 at 23:50 UTC |
In Section
Seekers of Perl Wisdom