in reply to Re: Would you use a switch instead?
in thread Would you use a switch instead?

Can you please show me how you would use a do{} block instead of local?

Replies are listed 'Best First'.
Re^3: Would you use a switch instead?
by FunkyMonk (Bishop) on Jul 04, 2009 at 13:42 UTC
    my $foo = do { local $_ = $value; /aaa/ ? 'wanna' : /bbb/ ? 'be' : /ccc/ ? 'startin' : 'somethin' };
      Sweet. I like that. Thanks.