in reply to Variable scoping in packages
Here's a forehead-smacker (made this mistake myself):
arturo>perldoc -f our our EXPR An "our" declares the listed variables to be valid globals within the enclosing block, file, or "eval". That is, it has the same scoping rules as a "my" declaration, but does not create a local variable.
HTH
perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Variable scoping in packages
by gomez18 (Sexton) on Oct 10, 2001 at 00:36 UTC |