Connecting Tech Pros Worldwide Forums | Help | Site Map

class? :: notion

T Chheng
Guest
 
Posts: n/a
#1: Jul 19 '05
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

Jim Gibson
Guest
 
Posts: n/a
#2: Jul 19 '05

re: class? :: notion


In article <465ab59d.0408161545.4b661022@posting.google.com >, T Chheng
<tcchheng@ucsd.edu> wrote:
[color=blue]
> 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.[/color]

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.
Closed Thread


Similar Perl bytes