Hello!
I am trying to adapt a CLI Perl script to work in a web page with Mason.
I pretty much dumped the code between <%perl> tags and tried to view the
page. The Apache process spawns at max CPU usage and doesn't stop. I
have to kill the process. Can anyone offer a suggestion?
(You'll see some commented out HTML as I was preparing to convert the
output to HTML)
Thanks!
<%perl>
use strict;
my $server_root = '/opt/apache/htdocs/some_dir';
sub recurse($) {
my($path) = @_;
## append a trailing / if it's not there
#$path .= '/' if($path !~ /\/$/);
## print the directory being searched
#print $path,"\n";
## Display in HTML table
## loop through the files contained in the directory
#print "<ul>";
for my $eachFile (glob($path.'*')) {
## if the file is a directory
if( -d $eachFile) {
## pass the directory to the routine ( recursion )
recurse($eachFile);
} else {
## print the file ... tabbed for readability
print $eachFile;
}
}
#print "</ul>";
}
</%perl>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<%perl>
recurse($server_root);
</%perl>
</body>
</html>
--
Doug Dawson
Application Developer
Physicians Mutual Insurance Company
(402) 930-2432
The problem with troubleshooting is that trouble shoots back.
____________________________________________________________
This message and any attachments are confidential, may contain privileged
information, and are intended solely for the recipient named above.
If you are not the intended recipient, or a person responsible for
delivery to the named recipient, you are notified that any review,
distribution, dissemination or copying is prohibited. If you have
received this message in error, you should notify the sender by return
email and delete the message from your computer system.
begin:vcard
n:Dawson;Doug
tel;work:402.930.2432
x-mozilla-html:FALSE
url:http://www.physiciansmutual.com
org:;ETG
adr:;;2600 Dodge St.;Omaha;NE;68131;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Programmer
fn:Doug Dawson
end:vcard
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users