Right, I'll use do. It just does what I want.
I have to use require for the same reasons
AutoLoader uses require and not just do FILE.
do FILE, when wrapped in a string eval
my $sub = eval "package $package; do '$file'";
doesn't set $@ outside the eval. require dies, do does not.
$sub is just undef, nothing more, and all I can do is mumble "something went wrong while 'do $file' at line $foo"
which ain't any good.
I need require; requiring a file twice happens only at development time (or if you do funny things like generating template source on the fly and ask for trouble unless you know what you're doing); it provides for re-compiling on
the fly and shortens turnaround time.
I'll include an argument to the package's import() function - recompile_on_change - which will enable such behaviour, and note the implications prominently in the
code and in the pod.
Does that stand to your scrutiny?
thanks for the hint again,
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|