[Tallahassee-pm] (No subject)
perl at bay.flrealtor.net
perl at bay.flrealtor.net
Sun Jan 19 11:40:31 CST 2003
This file works on my computer but when I upload it to a unix system and
try it from the internet it gives me a 500 error. Can anyone tell me what
the problem is?? Still new at perl.
Thanks
#!/usr/bin/perl
use CGI qw(:all);
use strict;
print header;
print "Directory to search: ";
my $dir=<STDIN>; chomp $dir;
my $dir="/home/lender/nameofdirectory/blankpage";
my($file);
opendir(DH, $dir) || die "Cannot open $dir: $!";
while ($file=readdir DH) {
next if (-d "$dir/$file");
if (! open(F, "$dir/$file") ) {
warn "Cannot search $file: $!";
next;
}
open(DEST, "> $file") || die "$!";
while(defined($a=<F>)){
$a=~ s/blankpage/newsite/;
print DEST $a;
}
close(DEST);
close(F);
}
closedir(DH);
More information about the Tallahassee-pm
mailing list