AZed has asked for the wisdom of the Perl Monks concerning the following question:
I'm getting differing behaviour on two chunks of code that are (according to PerlDoc) supposed to be identical.
This works:
my @fields = qw( opffile spec twig twigroot twigmeta error ); require fields; fields->import(@fields);
This doesn't:
my @fields = qw( opffile spec twig twigroot twigmeta error ); use fields @fields;
Could someone please explain why?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: When is "use module" not the same as require+import?
by Corion (Patriarch) on Sep 18, 2008 at 18:21 UTC | |
by AZed (Monk) on Sep 18, 2008 at 19:23 UTC | |
by JadeNB (Chaplain) on Sep 18, 2008 at 20:34 UTC | |
by ikegami (Patriarch) on Sep 19, 2008 at 19:20 UTC | |
by Bloodnok (Vicar) on Sep 19, 2008 at 16:51 UTC | |
|
Re: When is "use module" not the same as require+import?
by moritz (Cardinal) on Sep 18, 2008 at 18:46 UTC | |
by ikegami (Patriarch) on Sep 19, 2008 at 19:28 UTC | |
|
Re: When is "use module" not the same as require+import?
by ikegami (Patriarch) on Sep 19, 2008 at 19:23 UTC |