in reply to question about variabies/references (ignore my previous botched entry)
Because $main::scott is aliased to $skot2, accessing it gets you the same value ("surprise!"). Because you're in package main, you can leave off the $main:: portion, and accessing $scott also gets you your "surprise!".
These are three or four things that will eventually surprise any new Perl programmer. Using strict and -w will warn you when these things happen (except for autovivification in hashes, which is worth another page of explanation). Use them liberally!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: question about variabies/references (ignore my previous botched entry)
by btrott (Parson) on Apr 05, 2000 at 20:12 UTC | |
by chromatic (Archbishop) on Apr 05, 2000 at 21:57 UTC | |
by btrott (Parson) on Apr 05, 2000 at 22:30 UTC |