If that is your exact code you are trying to use, then it is missing the "shebang!" line. In Windows, you probably have file association doing the work for you in relating your Perl script to whatever Perl you have installed (Strawberry, Activestate,etc...).
But, on the Unix/Linux platform, you can add the program to execute your script on the first line:
#!/usr/bin/perlOtherwise, you can also run your script by calling "perl", followed by your script name as the argument:
$ perl my_script.plOn Unix/Linux, just type "which perl" at the prompt and that will tell you the path to use when you add the "shebang!" line at the top of your code
So, your first few lines of you code would look like this:
#!/usr/bin/perl use Net::SSH::Any; use Config::IniFiles; # Check for valid number of arguments if (!defined $ARGV[0] && !defined $ARGV[1]) { die("Usage: export_ddts.pl projectname tmpl_path \n"); }; . . .
The only thing left would to just make it executable:
chmod +x myScript.pl...and you will be able to run it by just typing its name at the prompt.
$ ./myScriptNOTE: this just assumes that your posted code is exactly what you are trying to execute and I just noticed the "shebang!" missing. If I'm way off target, my bad. :)
In reply to Re: Query on Running perl Script in linux
by dbuckhal
in thread Query on Running perl Script in linux
by naghaveer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |