[Tallahassee-pm] Fw: (No subject)

perl at bay.flrealtor.net perl at bay.flrealtor.net
Sun Jan 19 12:56:25 CST 2003


Ok, found out why I am getting this error...
Premature end of script headers????

What does that mean??

Anyone?


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



-----Original Message-----
From: perl at bay.flrealtor.net
Sent: Sun, 19 Jan 2003 12:40:31 EST
Subject: (No subject)


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