in reply to Re^2: (Mis)Understanding <c>grep...eq $_<c>
in thread (Mis)Understanding grep...eq $_
Ooh, nice! That's eminently readable. Much more likely to survive a code review than aristotle's ex-bang-bang operator.
Rather than
my @part = ( 'http://example.net/app', ( 'admin' ) x!! $is_admin_link, ( $subsite ) x!! defined $subsite, $mode, ( $id ) x!! defined $id, ( $submode ) x!! defined $submode, );
we would now have
my @part = ( 'http://example.net/app', grep( $is_admin_link. 'admin' ), grep( defined($subsite), $subsite ), $mode, grep( defined($id), $id ), grep( defined($submode), $submode ), );
I like it.
• another intruder with the mooring in the heart of the Perl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: (Mis)Understanding grep...eq $_ (versus ex-bang-bang)
by parv (Parson) on Feb 24, 2009 at 08:08 UTC | |
by grinder (Bishop) on Feb 24, 2009 at 23:39 UTC |
In Section
Seekers of Perl Wisdom