in reply to Do Mooses always want to face north?
In the second snippet, you're using the "module" before it has had a chance to execute. Specifically, you're creating the object before has has had a chance to execute.
Change
... { package test; ... } ...
to
... BEGIN { package test; ... } ...
use has an implicit BEGIN, but Perl doesn't provide a means for user function such as has to have an implicit BEGIN.
PS - There's a lot of moose (the life-size fiberglass kind) in Toronto, and they face in every which direction.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Do Mooses always want to face north?
by BrowserUk (Patriarch) on Jun 14, 2008 at 18:12 UTC | |
by Popcorn Dave (Abbot) on Jun 14, 2008 at 18:30 UTC | |
by swampyankee (Parson) on Jun 14, 2008 at 19:04 UTC | |
by Popcorn Dave (Abbot) on Jun 14, 2008 at 19:19 UTC | |
by Gavin (Archbishop) on Jun 15, 2008 at 09:42 UTC |