Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl script not running properly...

Reply
Thread Tools

Perl script not running properly...

 
 
abstractjoe
Guest
Posts: n/a
 
      07-11-2003
Hi,

I wrote a CGI script in Perl(see below) and when I execute ./ in Unix
console it works just fine. However, when I use it in an html page it
doesn't work.

Below is the form tag within my html page.

<form name="the_script" method="POST"
action="http://www.mydomain.com/cgi-bin/the_script.cgi">
<input type="submit" value="the_script">

So, when I hit submit it takes me to the redirect, however when I
check the files to see if they are replaced, nothing...

If I just run the script in Unix via ./ the files are replaced...
weird.

Below is the CGI script:

#! /usr/bin/perl
use File::Find;
use File::Copy;
use File:ath;

my $top_src = "/usr/local/whatever";
my $dest = "/usr/local/htdocs/whatever";

find sub {
##might need it for later on
##ignore non html files
return unless -f ;

my $more_subdir;
for ( $more_subdir = $File::Find::dir) {
s#^\Q$top_src##;
s#^/##;
}

## don't copy if we already have a later file
if (-e "$dest/$more_subdir/$_" and -M "$dest/$more_subdir/$_" <= -M
$_) {
## tracing: turn off when you're happy
warn "ignoring older $File::Find::name\n";
return;
}

mkpath( ["$dest/$more_subdir"], 0, 0711); # $dest must be an
absolute

## tracing: turn off when you're happy
$content = warn "copying $File::Find::name to
$dest/$more_subdir/$_\n";
copy $_, "$dest/$more_subdir/$_";
}, $top_src;

$url = "http://www.mydomain.com/redirect.html";
print "Location: $url\n\n";
exit;
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ calling perl script - Not able to get the stack arguments pushedrom XPUSH in perl script Yogi Perl Misc 1 09-13-2012 11:30 AM
Trouble running Perl script from within a Perl script laredotornado@zipmail.com Perl Misc 4 07-29-2011 01:44 PM
How to fetch output of some other script in the current running perl script? ritugoyal12@gmail.com Perl Misc 4 10-27-2007 03:52 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments