Yes, you can.
package MyPackage; $is_require = (caller(0))[7]; if($is_require) { print "I'm a module!\n"; } else { print "I'm a program!\n"; }
caller rocks.
bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.
In reply to Re: It's a Module. It's a program. Can it be?
by bbfu
in thread It's a Module. It's a program. Can it be?
by dcorbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |