Finding 'path to perl' of remote server

R

Randal L. Schwartz

Rafael> Perhaps a solution to your problem is to put

Rafael> #!/usr/bin/env perl

Rafael> at the 1st line of your perl programs (if you have env(1)). See the
Rafael> perlrun manpage.

Except that env(1) isn't portable, and on a few systems, they put
it into /usr/ucb (or was it /bin?) instead of /usr/bin!

Gah.
 
V

Vijoy Varghese

Hello Group,

I was wondering if it's possible to find the 'path to perl' on a
remote server.

This is what I want. I want to install a CGI script automatically on a
remote webserver using FTP. For this I am going to use the perl module
Net::FTP. After reading the manual of this module I found that almost
everything about installing a CGI script can be automated [Create
directory, put a cgi file, chmod it], but how to get the 'path to
perl' of that remote server? If there is some way to get it then I can
add that as the first line of the cgi file, and thus can achieve my
goal of 'automatic remote CGI/Perl script installation'.

Actually I never checked if all other parts[mkdir, cp, chmod] is
practically possible using this module, because there is no meaning in
doing those unless I can find some way to find the 'path to perl'.

So is 'finding path to perl on remote server' something really
possible? Or is this just a "DREAM"?

Thanking you all in advance

Regards
Vijoy Varghese
 
R

Rafael Garcia-Suarez

Vijoy Varghese wrote in comp.lang.perl.misc :
I was wondering if it's possible to find the 'path to perl' on a
remote server.

Perhaps a solution to your problem is to put

#!/usr/bin/env perl

at the 1st line of your perl programs (if you have env(1)). See the
perlrun manpage.
 
V

Vijoy Varghese

Except that env(1) isn't portable, and on a few systems, they put
it into /usr/ucb (or was it /bin?) instead of /usr/bin!

So you guys mean to say that there is no 'reliable' solution to my problem :-?

Vijoy~
 
R

Rafael Garcia-Suarez

Vijoy Varghese wrote in comp.lang.perl.misc :
So you guys mean to say that there is no 'reliable' solution to my problem :-?

This is a UNIX-dialect problem. That means that there's no universal, fully
portable solution...

(you can also check perlrun for that weird solution that involves eval
and exec.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top