MLUG: RE: [MLUG - DISCUSSION] Dumb Perl Question
RE: [MLUG - DISCUSSION] Dumb Perl Question
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How about this for a very rough starting point:

### Code starts here

#! /usr/bin/perl

use CGI;

$show_base = "/usr/local/apache/htdocs/";
$show_dir = "manual";

$cgi = new CGI;

print $cgi->header();

print $cgi->start_html;

opendir(DIR, $show_base.$show_dir) || die "can't opendir $show_dir: $!";

@files = readdir(DIR);

closedir DIR;

foreach $file_name (@files)
   {
   print "<A HREF=\"/$show_dir/$file_name\">", $file_name, "</A><BR>";
   }

print $cgi->end_html;

### Code ends here

Bill Anderson

-----Original Message-----
From: EMAIL:PROTECTED
[mailto:EMAIL:PROTECTED]On Behalf Of Davis, Ryan
Wiley (UMC-Student)
Sent: Tuesday, May 07, 2002 1:12 PM
To: EMAIL:PROTECTED
Subject: [MLUG - DISCUSSION] Dumb Perl Question


Okay,

So I am looking for a bit of perl to put into a CGI and I am kindof lost on
exactly how to do it. Let me describe.

I want the perl to read the filenames in a certain sub directory of my web
account. There are a few files 10-30 in this directory. I would then like
the perl code to output (into HTMLof course) the listing of said directory
and a link to access all these files. 

I'm currently messing with different ways of doing this, but wanted to know
if any of you monkeys out there have already done something like this and
have a quick and easy solution.

-Ryan

--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php

Archives are available at http://mlug.missouri.edu/list-archives/

Attachment: bin00000.bin
Description: application/ms-tnef