Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Help needed understanding global variables in Perl

by Juerd (Abbot)
on Mar 05, 2002 at 12:18 UTC ( #149340=note: print w/ replies, xml ) Need Help??


in reply to Re: Help needed understanding global variables in Perl
in thread Help needed understanding global variables in Perl

The closest thing to a global variable are either "magical" variables or punctuation variables.

No. All punctuation variables are global, and some are magical. Not every global is a punctuation variable or magical. $foo is a valid global scalar that goes in foo's stash, just like @foo.

++ vs lbh qrpbqrq guvf hfvat n ge va Crey :)
Nabgure bar vs lbh qvq fb jvgubhg ernqvat n znahny svefg.
-- vs lbh hfrq OFQ pnrfne ;)
    - Whreq


Comment on Re: Re: Help needed understanding global variables in Perl
Re: Re: Re: Help needed understanding global variables in Perl
by shotgunefx (Parson) on Mar 05, 2002 at 13:28 UTC
    Are punctuation variables truly global or are they forced to be in main:: when unqualified?

    -Lee

    "To be civilized is to deny one's nature."
      They are forced into main::, but they are global. You can abuse this by starting your string with a control character: ${^Foo} is also forced into main::. (it's actually ${"\cFoo"})

      ++ vs lbh qrpbqrq guvf hfvat n ge va Crey :)
      Nabgure bar vs lbh qvq fb jvgubhg ernqvat n znahny svefg.
      -- vs lbh hfrq OFQ pnrfne ;)
          - Whreq
      

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-09-23 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls