Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^2: defined defined -- Bug or "Feature"?

by GrandFather (Sage)
on Dec 24, 2015 at 08:00 UTC ( #1151099=note: print w/replies, xml ) Need Help??

in reply to Re: defined defined -- Bug or "Feature"?
in thread defined defined -- Bug or "Feature"?

You state that like you know it to be the case, but I couldn't see that behavior described in the documentation. Do you know this from the code?

Premature optimization is the root of all job security
  • Comment on Re^2: defined defined -- Bug or "Feature"?

Replies are listed 'Best First'.
Re^3: defined defined -- Bug or "Feature"?
by dave_the_m (Monsignor) on Dec 24, 2015 at 09:33 UTC
    The docs say that it returns a boolean value, i.e. a true or false value. It would be surprising for a false value to also be undefined, as you would get 'undefined' warnings if you tried using operators on the results. This shouldn't warn:
    $x = defined($y) ^ defined($z);


Re^3: defined defined -- Bug or "Feature"?
by Anonymous Monk on Dec 24, 2015 at 09:29 UTC
    I guess he didn't (guess). It's easily tested...
    print defined( undef ) // 'n/a'; print defined( undef ) || 'n/a'; n/a

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2020-09-28 14:38 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (144 votes). Check out past polls.