Dear Log,
My for
trick of the day, with HTTP::Response objects:
for my $c (${ $response->content_ref }) {
$c =~ ...stuff...;
$c =~ ...stuff...;
$c =~ ...stuff...;
}
Re:Why not use $_?
TorgoX on 2002-02-25T18:30:39
well, the actual block in the foreach block involved more stuff going on, and calls to different subs. And I'm never happy calling subs when I have something important in $_ -- because if the subs later are rewritten to incidentally clobber $_, I'll have a hard time figuring out the resulting bug. And I'm just not that big into assigning/aliasing to $_ in general, except for tiny tiny things like:
for($k,$v) {tr/\cm\cj//d; s/^\s+//; s/\s+$//; }