Syntactic Confectionery Delight | |
PerlMonks |
Re: my $variable with &&do{} doesn't compileby Tanalis (Curate) |
on May 26, 2003 at 09:06 UTC ( [id://260801]=note: print w/replies, xml ) | Need Help?? |
The way I understand this is that in the first instance, you're creating the $epoch variable before it's used within the expression.
In the second example, however, you create the variable at the same time as you attempt to use it. As the variable doesn't exist until after the statement is executed (which doesn't happen until the compiler hits the semi-colon), it's not possible to pass it into a function within that statement. I will point out that I'm not 100% sure about this, though - this is based on someone else's attempt at explaining a similar problem to me. Hope that helps .. -- Foxcub
In Section
Seekers of Perl Wisdom
|
|