Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by radiantmatrix (Parson)
on Aug 02, 2006 at 14:19 UTC ( [id://565231]=note: print w/replies, xml ) Need Help??


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

Actually, most of your objections don't seem to apply.

  1. I already include the slashes through use of $uri.="$_/"
  2. The $is_admin_link && 'admin' is in the right order already

As for the 0/1 problem with $is_admin_link, that's a fault of my assumption that $is_admin_link would either be true or undefined. I agree, that's a bad assumption, but it's a simple fix. I would probably use a single ternary:

$is_admin_link ? 'admin' : undef
<radiant.matrix>
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Replies are listed 'Best First'.
Re^4: Secret Perl Operators: the boolean list squash operator, x!!
by Aristotle (Chancellor) on Aug 02, 2006 at 15:35 UTC

    Read closer. I said “the last paragraph.” Here is said paragraph, in order to avoid further confusion.

    Not to mention that all of this misses my point because it’s specific to join, and I’ve needed to pass a variable list to some function or method often enough where really needed the sub-list to be empty depending on the condition – winging it by combining && and the false evaluates to the empty string factoid wouldn’t have done me any good.

    Try to simplify a different example to get closer to my point.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-19 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found