class? :: notion

T

T Chheng

hey,
I'm looking over some perl code and came across this: $Z::status and
$G::new

I know that the :: is like a '.' in Java, but are $Z and $G special
variables? I dont see them defined anywhere in the script.

thanks
 
J

Jim Gibson

T Chheng said:
hey,
I'm looking over some perl code and came across this: $Z::status and
$G::new

I know that the :: is like a '.' in Java, but are $Z and $G special
variables? I dont see them defined anywhere in the script.

Z and G are package names. The $ attaches to Z::status, not just Z
alone. Think of it as '${Z::status}'. 'status' is a symbol in the
symbol table for package Z.

Look for lines such as 'package Z' line in your source code. These
lines might be in a separate file if you have 'do', 'eval', 'require',
or 'use' in your program.

FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top