Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Can you create *real* global variables?

by moodster (Hermit)
on Jan 25, 2002 at 19:01 UTC ( #141504=note: print w/ replies, xml ) Need Help??


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

The only global variables that I know of are the one's created by perl, and they tend to be magical (e.g $! yields the current value of errno when in a numerical context, and an error message in a string context).
I'm having a cold and my brain is only operating at half speed right now, so maybe I'm just confused. But I always thought that variables lived either in scalar or list context. Are there such beasts as numerical and string contexts as well?

Cheers,
-- moodster


Comment on Re: Can you create *real* global variables?
Replies are listed 'Best First'.
Re^2: Can you create *real* global variables?
by blazar (Canon) on Mar 12, 2007 at 11:52 UTC
    I'm having a cold and my brain is only operating at half speed right now, so maybe I'm just confused. But I always thought that variables lived either in scalar or list context. Are there such beasts as numerical and string contexts as well?

    Indeed in Perl 5 (and earlier), as opposed to Perl 6, there is no precise notion of numerical or string contexts. However those terms are sometimes loosely used to indicate "used as a number" and "used as a string respectively": in some cases, but by no means in all of them, there's an actual difference.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-07-30 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls