NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Huh? (Score:1)
I don’t see what’s wrong with that.
You probably won’t like the way I’d write it either:
Re: (Score:1)
givenmakes that a little less obscure to those unfamiliar with the idiom, or rather, since setting$_is the only point ofgiven, noone has to stop and think 'what's he looping over again?'Re: (Score:1)
Now it's my turn to go 'Huh?' (Score:1)
It's a copy? Why on earth? Nothing in Perl copies its parameters. Doesn't that just make the whole feature hugely less useful? It's not as though
given (my $tmp = $x) {}is that obscure, especially given its common use in conjunction withs///...Oh, and look:
OK, I'll stop thinking
givenmight be useful and start getting used to the idea offor/whenstatements instead.</splutter>Reply to This
Parent
Re: (Score:1)
I suppose it’s nice to be able to write
given ( $foo )in place offor ( my $copy = $foo ). But yeah, that threw me too. It’s a pity; a missed opportunity, even.The fact that you can’t use
givenas a statement modifier doesn’t bother me.