Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Converting to boolean

by QM (Parson)
on Jun 18, 2004 at 01:42 UTC ( #367831=note: print w/replies, xml ) Need Help??


in reply to Re^2: Converting to boolean
in thread Converting to boolean

.. which would otherwise do the wrong thing for a filename such as "0".
Umm, perhaps I'm being too picky, but I think that was a flawed example.
defined($filename) && length($filename)
would evaluate correctly, regardless of the actual filename.

Now, if you tried just $filename as the return value, that would be problematic...

-QM
--
Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-08-03 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (40 votes). Check out past polls.

    Notices?