Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Using hash value as condition.

by graff (Chancellor)
on Mar 30, 2014 at 00:57 UTC ( #1080248=note: print w/replies, xml ) Need Help??

in reply to Using hash value as condition.

The point here is that "false" is not a reserved word (or a built-in function) in Perl, so it has no special meaning. In your snippet, it's treated as a "bareword", which you can look up under "B" in the perlglossary:

A word sufficiently ambiguous to be deemed illegal under use strict 'subs'. In the absence of that stricture, a bareword is treated as if quotes were around it.

In other words:

perl -le '$x = false; print length($x); print "x is ".join("-",split// +,$x)'
(that will print out two lines: "5" and "x is f-a-l-s-e")

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080248]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-07-25 03:37 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (363 votes). Check out past polls.