Anyway, read perldoc -f use, perldoc -f require, perldoc -f import, and perldoc -f caller.
caller will tell you what you need to know. How called was &I? further explores this (I being a function, just like import).
update: silly rabbitBiker, tricksBEGIN blocks will always get executed, observe
#moo.pm package moo; BEGIN { warn "moo ".join'',caller(1); } sub import { warn "import ".join'',caller(1); } 1; __END__ E:\new>perl -e"use moo;" moo mainmoo.pm5(eval)000 at moo.pm line 4. import mainmoo.pm1main::BEGIN100 at moo.pm line 8. E:\new>perl -e"require moo;" moo mainmoo.pm5(eval)000 at moo.pm line 4.
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
In reply to Re: Was my module used or required?
by PodMaster
in thread Was my module used or required?
by Biker
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |