Not exactly. The documentation says:
It is exactly equivalent toBEGIN { require Module; Module->import( LIST ); }
And the BEGIN{} block makes all the difference. The BEGIN means that the code is run immediately after Perl has reached the closing curly brace. Which is well before Perl runs the code that initializes your @fields array. Putting the assignment to @fields into a(nother) BEGIN block would alleviate that problem.
In reply to Re: When is "use module" not the same as require+import?
by Corion
in thread When is "use module" not the same as require+import?
by AZed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |