Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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?
[shmem]: well finally.
[stevieb]: nice! I just finished a GPS "take me home" device last week, and did a bunch of software updates to it yesterday. I also created a pseudo chip with an Arduino to simulate an IC, where it responds to register read/writes over the I2C bus...
[stevieb]: ...from an I2C master. It's ugly and there are many changes I'm going to make, but I had not done anything like it before. It's designed for my RPi:: automated test platform; a system that does CI on *all* my RPi modules.
[shmem]: pseudo chip?

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-06-25 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.