N
nomadx
hello, could someone please check this out?
#usr/local/bin/perl
# Filelist.pl version 0.1
use strict;
use CGI qwall);
use CGI:retty;
#use CGI::Carp qw(fatalsToBrowser);
use Cwd;
my ($query, $showdrive, $currentdir, @filelist, $file);
$currentdir=getcwd;
unless ($showdrive) {
$currentdir=~s/^(\w\//; #remove drive letter and trailing colon
$currentdir=~s/([^\/\\]$)/$1\//; #put on trailing slash
}
$query=CGI->new();
opendir(DIR,".");
@filelist=readdir(DIR);
print header('text/plain');
print $query->start_html(title=>'/dave/ Index'
);
print h1("File contents of : ",$currentdir);
foreach $file (@filelist){
# print a({href=>$file,target=>'_self'},$file); print "<br>";
}
print $query->end_html;
###########################################
it prints the following output.
prints the following output:
Content-Type: text/plain; charset=ISO-8859-1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en-US"><head><title>title</tit
e>
<link rev="made" href="mailto:%2Fdave%2F%20Index" />
</head><body><h1>
File contents of :
</h1>
<a href="." target="_self">.</a>
<br><a href=".." target="_self">..</a>
<br><a href="filelist.pl" target="_self">filelist.pl</a>
<br></body></html>
i'm getting the error "premature end of script headers"
where can i find the error documentation, and what's wrong with the header?
also, i've been trying the CWD module and on some systems it fails because
it demands root access. it gets denied and the program crashes. is there any
way for it to work without doing that? or is there another module that does
the same thing but won't need root access?
thanks,
chris berkelaar
#usr/local/bin/perl
# Filelist.pl version 0.1
use strict;
use CGI qwall);
use CGI:retty;
#use CGI::Carp qw(fatalsToBrowser);
use Cwd;
my ($query, $showdrive, $currentdir, @filelist, $file);
$currentdir=getcwd;
unless ($showdrive) {
$currentdir=~s/^(\w\//; #remove drive letter and trailing colon
$currentdir=~s/([^\/\\]$)/$1\//; #put on trailing slash
}
$query=CGI->new();
opendir(DIR,".");
@filelist=readdir(DIR);
print header('text/plain');
print $query->start_html(title=>'/dave/ Index'
);
print h1("File contents of : ",$currentdir);
foreach $file (@filelist){
# print a({href=>$file,target=>'_self'},$file); print "<br>";
}
print $query->end_html;
###########################################
it prints the following output.
prints the following output:
Content-Type: text/plain; charset=ISO-8859-1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en-US"><head><title>title</tit
e>
<link rev="made" href="mailto:%2Fdave%2F%20Index" />
</head><body><h1>
File contents of :
</h1>
<a href="." target="_self">.</a>
<br><a href=".." target="_self">..</a>
<br><a href="filelist.pl" target="_self">filelist.pl</a>
<br></body></html>
i'm getting the error "premature end of script headers"
where can i find the error documentation, and what's wrong with the header?
also, i've been trying the CWD module and on some systems it fails because
it demands root access. it gets denied and the program crashes. is there any
way for it to work without doing that? or is there another module that does
the same thing but won't need root access?
thanks,
chris berkelaar