in reply to Re: Secret Perl Operators: the boolean list squash operator, x!!
in thread Secret Perl Operators: the boolean list squash operator, x!!
Wouldn't it make more sense to have the contents of the square brackets the other way around? e.g:
@part = map defined $_->[0] ? @{$_}[(@$_>1?1:0)..$#{$_}] : (), [1 => 'http://example.net/app', 'extra'], [$is_admin_link => 'admin'], [$subsite], [1 => $mode], [$id], [$submode];
To my eyes, [ $condition => $value ] reads better.
Also allows you to do: [ $condition => $list, $of, $values ]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Secret Perl Operators: the boolean list squash operator, x!!
by blazar (Canon) on Jul 18, 2008 at 15:08 UTC |
In Section
Meditations