Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Secret Perl Operators: the boolean list squash operator, x!!

by Aristotle (Chancellor)
on Aug 02, 2006 at 15:46 UTC ( #565250=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Secret Perl Operators: the boolean list squash operator, x!!
in thread Secret Perl Operators: the boolean list squash operator, x!!

Sorry, but I find that 10◊ less readable than doing the work in place would be. In a realistic codebase, these pieces would be far apart, and making sure you understand exactly what is going on would require crossreferencing. Dependencies should not be introduced without cause, as they always carry a cost. Your suggestion is just an overmodularised version of this:

my $uri = join '/', 'http://example.net/app', grep { defined } ( ( $is_admin ? 'admin' : undef ), $subsite, $node, $id, $subnode, );

That is basically tyeís suggestion. And itís a fine suggestion if you can resolve the irregularities enough to do it this way. But it doesnít cover all cases that x!! can Ė see my other example where grep is clearly inappropriate.

Makeshifts last the longest.


Comment on Re^4: Secret Perl Operators: the boolean list squash operator, x!!
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://565250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-10-23 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls