CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Hi, is it possible to call perl script placed on a windows shared location through CGI ?

 



karthikraju.n
Novice

Feb 4, 2014, 10:59 PM

Post #1 of 2 (747 views)
Hi, is it possible to call perl script placed on a windows shared location through CGI ? Can't Post

Hi, is it possible to call perl script placed on a windows shared location through CGI ?

We are passing a variable from a html file to cgi script and then we are passing the same variable from the cgi script to a perl script.

Now there are two cases:-

1) If the perl script exists in my local machine (where the html and cgi are existing in tomcat server), then it is working fine as expected.

2) But when we are trying to pass variable to a perl script which is placed on some shared location (other than my local machine) where tomcat is not present, then it is not working.

Please help on this

.html:-
<form method="post" action="cgi-bin\PerlFilerScript.cgi" target="_blank">
User Name <input type="text" name="username"> <br>
<input type="submit" name="submit" value="submit">
</form>

PerlFilerScript.cgi :-

use CGI;
$q=new CGI;
print $q->header;
print "<html>";
print "<head><title>Test</title></head>";
print "<body>";
$username=$q->param('username');
$cmd = "perl ////abc//abcde//xxxx//yyyyy//PerlFilerScript.pl $username"; # This is not working
#$cmd = "perl PerlFilerScript.pl $username"; # This line is working
system("start $cmd");
print "</body>";
print "</htm>";


PerlFilerScript.pl:-

my $file = "file.txt";
unless(open FILE, '>'.$file) {
die "\nUnable to create $file\n";
}
print FILE "Hello world\n";
close FILE;

Thanks,
Karthik



FishMonger
Veteran / Moderator

Feb 5, 2014, 7:23 AM

Post #2 of 2 (727 views)
Re: [karthikraju.n] Hi, is it possible to call perl script placed on a windows shared location through CGI ? [In reply to] Can't Post

Are the local and remote servers both Windows or both *nix or a mix?

From the command line of the local server instead of executing the script can you simply do a directory listing using the unc path?

From the command line of the local server can you execute the remote script using the unc path?

Same questions again but instead of connecting using your user account, you connect using the same user account that runs tomcat?

Are you prompted for authentication?

Do you receive any errors when running those tests? If so what are they?

If these tests fail from the command line, then they will also fail when executed from the cgi script.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives