--- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> Speaking of which, you forgot your trailing semicolon
> for the C<when> expression's final closure/block.
I'll claim that when, like if, shouldn't need one. (I'd also normally
use multiple lines, but I'm trying to conserve newlines... :-)
> Why does C<when>'s EXPR pay attention to the topicalizer regardless
> of associated variable?
Because two contexts (switch/case and CATCH) suggest that as "obvious"
behavior, and C<when> is targeted at those contexts. (CATCH is really a
variation of a switchish theme, but still...)
Example:
given $x % 3 {
when 0 { ... }
when 1 { ... }
when 2 { ... }
default { print "Surprise!\n"; }
}
for @A {
fragile();
CATCH {
when Exception::PEBKAC { ... }
when Exception::NotANumber { ... }
}
}
=Austin
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com