in reply to Wrapping requires in a package...
update cuz the discussion on the CB shows I did not get my point thrumy $evalstr; { local (*F, $/); undef $/; open F, './foo.pl'; $evalstr = 'package foo; ' . <F>; } eval $evalstr or die $@;
try: perl -e 'package foo; require "foo.pl"' with the content of foo.pl being simply print __PACKAGE__ and you will see that "main" is printed, not "foo"
-- stefp
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Wrapping requires in a package...
by tye (Sage) on Sep 08, 2001 at 00:42 UTC |