Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Possible to have a module act as a standalone??

by thor (Priest)
on Mar 19, 2003 at 06:20 UTC ( #244260=note: print w/replies, xml ) Need Help??


in reply to Re: Possible to have a module act as a standalone??
in thread Possible to have a module act as a standalone??

you want a module that can be run as a script, but the search paths for scripts (OS determined) and modules (Perl determined) are different. if it's in a place where it could be run as a script, then it can't be loaded as a module w/o hackery. ditto for the reverse, if it's in a place where it could be loaded as a module (use Foo;) then it's not in a place where it could be called as a script.
Jigga-what? There is nothing saying that @INC and your PATH environment variable have to be disjoint. I'm not saying that it's a good idea to have overlap (nor am I saying that it's a bad idea; kinda titilating, actually), but you could put a new directory that is understood to contain such hybrid scripts at the end of both @INC and PATH:
push @INC, "/path/to/hybrids" setenv PATH $PATH:/path/to/hybrids export PATH=$PATH:/path/to/hybrids ...
You get the idea.

thor

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://244260]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2019-07-20 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (5 votes). Check out past polls.

    Notices?