RE: How to put a global variable in a package, accessible to users of that package?




Message du 31/10/08 10:25
De : "Stewart Anderson"
A : "mrstevegross" , beginners@xxxxxxxx

=== foo.pl ===
package foo;
use constant VAR => "someval";

=== bar.pl ===
use foo;
print $foo::VAR;

It doesn't appear to be working; it compiles ok, but it prints
nothing. I thought it would print "someval".

That looks interesting. How do people use that kind of constant
assignment.
That was not interesting. $foo::VAR is a wrong usage on his case. See Shawn's answer.

Jeff.
http://home.arcor.de/pangj/

Créez votre adresse électronique prenom.nom@xxxxxxxxxxx
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.