Velocity Reviews - Computer Hardware Reviews

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

Thread Tools

Perl script not running properly...

Posts: n/a

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"
<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...

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) {

## 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";

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

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

$url = "";
print "Location: $url\n\n";
Reply With Quote

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 Perl Misc 4 07-29-2011 01:44 PM
How to fetch output of some other script in the current running perl script? 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