Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Two meanings of undef

by davido (Cardinal)
on Aug 16, 2020 at 03:04 UTC ( [id://11120801]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
    eval 'undef $main::xyz;';
    
    print "After undef: \$xyz ", (exists($::{'xyz'}) ? 'exists' : 'does no
    +t exist'), "\n";
    
  2. or download this
    Before assignment: $xyz does not exist
    After assignment: $xyz exists
    42
    After undef: $xyz exists
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found