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

Re^7: Two meanings of undef (updated)

by AnomalousMonk (Bishop)
on Aug 16, 2020 at 04:10 UTC ( #11120804=note: print w/replies, xml ) Need Help??


in reply to Re^6: Two meanings of undef
in thread Two meanings of undef

The X variable in both of our code examples is not a constant, but a typeglob. This is shown by the fact that the statement
    say X;
    say $main::{X};
produces the output
    *main::X

If you want "proper" syntactic flexibility, maybe re-work both of our code examples with warnings and strictures enabled (see warnings and strict, respectively) and come back and we can debate some more. (Update: See also the Tutorial article Use strict and warnings and the articles linked therefrom.)

Update: See davido's reply for more insight into where X comes from.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-10-29 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (268 votes). Check out past polls.

    Notices?