Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re (tilly) 1: Can you create *real* global variables?

by tilly (Archbishop)
on Jan 25, 2002 at 02:09 UTC ( #141344=note: print w/replies, xml ) Need Help??

in reply to Can you create *real* global variables?

There are 2 ways I have seen to do this. One, 5.6 and higher, is to start the name with a ^. Blame Dominus for this hack. The other one is to start the name with a '.

In both cases the variable is always kept in package main. And both syntaxes will not be supported in Perl 6.

  • Comment on Re (tilly) 1: Can you create *real* global variables?

Replies are listed 'Best First'.
Re: Re (tilly) 1: Can you create *real* global variables?
by japhy (Canon) on Jan 25, 2002 at 02:45 UTC
    Except that starting a variable name with a ' is just a hack for starting it with a ::, which doesn't stop me from then appending a different namespace. The ^ hack is totally separate.

    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      I just said what would work, not why it does.

      You might also have noted that I did not say why each solution was going to not be supported in 6.0. I have to leave people some incentive to re-read the documentation! :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141344]
[LanX]: use module :all ?
[Lady_Aleena]: Lax, that would take it down to a little less than 100 characters. The module name is nearly 80 characters long.
Lady_Aleena has fumble fingers today.
[Lady_Aleena]: Sorry for the name typo LanX.
[LanX]: never lad_ena!
[LanX]: ;)
[Lady_Aleena]: IMO, Fancy::Join:: Grammatical isn't bad, but RolePlaying:: WorldBuilding:: WorldBuildersGuide book::ClimateTerra inSubsistance is on the long side.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-05-24 21:57 GMT
Find Nodes?
    Voting Booth?