O! wise ones, I need your wisdom on the usage of "use":
I have 3 perl modules..
Foo.pm:
Bar.pm:package Foo; use strict; sub foo { print "Foo\n"; } 1;
Now in a third perl module: Something.pmpackage Bar; use strict; use Foo; sub bar { print "Bar\n"; } 1;
I expected an error in Something.pm, for calling Foo::foo, when the package "Foo" was not used in package Something. However this works perfectly. I have read the "use" inheritance thread and the perldoc use ..package Something; use strict; use Bar; .... Foo::foo; 1;
1. Is this a good practise ?
2. How does this work ?
P.S: I run perl v5.8.5
In reply to use enlightenment by InfiniteLoop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |