Log in



Tags » ‘script’

How to run perl script in cygwin?

November 17th, 2010 by

Question by Kuan Hoong: How to run perl script in cygwin?
I am a newbie in perl. I would like to know what is the command to run a perl script in cygwin.

Best answer:

Answer by littlebhishma
You can run the perl script by the following ways:

1. on command prompt type /usr/bin/perl your_script_name and press enter
2. Or you can add the following line to the top of the perl script:
#!/usr/bin/perl

Once you add that line you execute the script by typing fully qualified script_name and press enter. To run a script in the current directory should ./script_name.extension (Unix will not look for the script in the current directory by default).

Add your own answer in the comments!

How to invoke a Perl Script (with arguments) or a windows batch file from a browser?

October 31st, 2010 by

Question by JJ S: How to invoke a Perl Script (with arguments) or a windows batch file from a browser?
How to invoke a Perl Script (with arguments) or a windows batch file from a browser using JavaScript or whatever? the ideal case is to show a button on a web page, then clicking on the button would call a batch file or a perl script to execute/invoke other applications.

Best answer:

Answer by ram
To do that requires a web server (best one for Perl and shell-scripts is Apache http://httpd.apache.org ) and some basic knowledge of how Perl scripts call up the interpreter. What you want to do is not exactly easy to do on windows – nevermind the fact the Unix/Linux world has been doing this for longer than windows has existed. The windows shell can’t do this by itself. Apache on windows will let you do this, however, by processing the “shebang” line in Perl (and any other) Shell or CGI script you want.

What do you think? Answer below!


Powered by Yahoo! Answers