in reply to Secret Perl Operators: the boolean list squash operator, x!!
Instead of using the x operator, we could have used the
the && operator. The advantage here is that it codes simpler,
and the disadvantage is it has no movable parts (since it is not an array).
no strict; no warnings; my $part = 'http://example.net/app' . ($admin && $is_admin_link) . (defined $subsite && $subsite) . $mode . (defined $id && $id) . (defined $submode && $submode) ; print $part;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Secret Perl Operators: the boolean list squash operator, x!!
by Aristotle (Chancellor) on Aug 01, 2006 at 09:25 UTC | |
by ioannis (Abbot) on Aug 01, 2006 at 10:24 UTC |
In Section
Meditations