>>Besides no one has commented on Steve Fink's (I think it was him) idea
>>to store the result of the most recently executed conditional in $?. I
>>kinda like that idea myself. It makes mnemonic sense.
Hmmmm . . . I could grow used to that. A couple of thoughts.
1) It doesn't seem to buy us much that $_ doesn't already, except some slight
legibility in that we can say what the variable holds as in:
foreach $PIN_number (@list) {
my $PIN = $PIN_number;
#Stuff
}
2) What about our new, more complex foreach:
foreach ($key, $value) %hash {
#What's $? here?
}
Perhaps we could use @_, since we're already used to that giving us arguments from
outside the current scope. Using @_ might very well be logical since custom iterators
will be using it anyway.
3) Even given 2 above I'm not sure that:
foreach ($key, $value) %hash {
my ($key, $value) = @_;
# Do stuff
}
is more useful than
do{
my ($key, $value);
foreach ($key, $value) { . . . }
}
simply because at the end of the first we have $key and $value still overwriting any
previous values, and they'll have values afterward. Even if a $? or @_ implementation
existed I'd probably use the do { . . . } anyway for that reason.
-Erik
Is your boss reading your email? ....Probably
Keep your messages private by using Lycos Mail.
Sign up today at http://mail.lycos.com