In your first example
sub foo { my $x = $_[0] eq 'whatever' ? $_[1] : $_[2]; ... }
Seems just as effective. But in your second, I agree. I've looked enviously at the perlsub examples of using globs to avoid the need to dereference refs and wished for a way to do the same thing with lexicals. Maybe Diotalevi's Lexical::TypeGlob would work for that? I haven't gotten around to playing with it yet.
In reply to Re: Re: Re: Lexical::Alias & subroutines
by BrowserUk
in thread Lexical::Alias & subroutines
by Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |