Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running perl script from PC when script and perl are on a server 1

Status
Not open for further replies.

llaber

MIS
Feb 3, 2010
4
US
I wrote a perl script that prompts the user for a file name. Then, it does some checking to see if the file exists and reprompts if the user enter a bad file name, the file has a string in it that it shouldn't, etc. This works fine from my PC which has Perl installed. Now I've moved the script to a Windows server and am trying to run it from a PC that doesnt' have perl. It just thinks the program is a text file. How do I get it to use Perl on the server? I don't want to have to install Perl on each PC. Or, if there's a simple way to display the files in the directory and get the user to select the file they want and then pass this to a perl program, then that would be great too. I am new to Perl and I am under a deadline. Any help would be appreciated.
 
I have figured out how to run it from a PC. I shared out the server's Perl drive and subdirectories with read/execute permissions. On the PC, I mapped the perl drive on the PC. Then, I created a bat file on the PC to run the Perl executable, calling the script. The script is also on the server, so it is also on a mapped drive. It might not be the best solution, but it works.
 
You can compile your script into a stand-alone .exe file for Windows.

You can use perl2exe (commercial, command-line) or ActiveState's PerlApp (commercial, graphical) to do this.

Or for a free method, look at PAR::packer -
All of the above will basically take your Perl interpreter and bundle it along with your script and all the modules your script needs, and create one single exe file that you can take to any other system that doesn't have Perl installed and it will run your script anyway.

Kirsle.net | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top