Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

open perl interpreter

by Anonymous Monk
on Aug 03, 2004 at 15:57 UTC ( #379718=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

All my perl file(interpreter and script) are in one folder. I would like to be able to move my folder anywhere in my hardisk. I know it make no sense, but I just want to know it. But the problem is how my script will find my perl interpreter in the same folder after I move the folder some where else( for example c:/perl to c:/desktop/perl)

Should I create an .exe file like this

system("??? "); so that the exe file will order perl interpreter to open script.pl.

So how do I do that????

TQ

Comment on open perl interpreter
Re: open perl interpreter
by Grygonos (Chaplain) on Aug 03, 2004 at 16:12 UTC

    I'm not following what you mean,however I think I understand. So long as your new path to perl is in the PATH environment variable, invoking "perl myscript.pl" from the directory where myscript.pl is located should invoke the interpreter on myscript.pl

    Is this what your are getting at?
Re: open perl interpreter
by PodMaster (Abbot) on Aug 03, 2004 at 17:49 UTC
    print $^X,$/; system $^X,'-e','print $^X,$/' __END__ C:\Perl\bin\perl.exe C:\Perl\bin\perl.exe

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: open perl interpreter
by gawatkins (Monsignor) on Aug 04, 2004 at 03:26 UTC

    Although I am not exactly sure what your are looking for, I think that you need to have your PATH enviromental variable adjusted. To do this in 2000/XP you can right click on My Computer and Go to Properties. From Properties, select the advanced tab, then Environment Variables at the bottom. The top "User Variables" sets the path for the current profile while "System Variables" sets the path for all users. Select the Path variable in the appropriate section and click edit. Add a semicolon (;) to the end of the current content to separate and then type the full path to the location of perl.exe, for example, "c:\perl\bin"


    Thanks,
    GW

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-09-19 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls