B::Deparse would've answered your question.
This is how perl sees your program:
BEGIN { $^W = 1; }
use CGI;
use CGI::Pretty;
use File::Basename;
use DirHandle;
use strict 'refs';
my $path = dirname('c:/pictemp/start.gif');
my @files;
opendir DIR, $path;
@files = readdir DIR;
my $junk;
if ($files[0] eq '.') {
$junk = shift @files;
}
if ($files[0] eq '..') {
$junk = shift @files;
}
my $query = 'CGI'->new;
print $query->header('text/html'), $query->start_html(-'title', 'Renam
+ing Digital Photos', -'bgcolor', '#ffffcc');
print "<form name=newNameForm method=post action=rename.cgi>\n";
print $query->input({-'name', 'baseDir', -'type', 'hidden', -'value',
+"$path"});
print "\n<table border=1><tr valign=top>\n";
my $file;
my $counter = 0;
my $tempFile;
foreach $file (@files) {
$tempFile = $path . '/' . $file;
print "<td>\n\t" . $file . "<br>\n\t";
print $query->input({-'type', 'hidden', -'name', "'hidden'.$counte
+r", -'value', "$file"});
print "\n\t";
print $query->input({-'type', 'text', -'name', "'newName'.$counter
+", -'size', '30', -'value', $file});
print "\n\t<img width=200 src=" . $tempFile . ">\n\t</td>\n";
if (++$counter % 3 == 0) {
print "</tr><tr valign=top>\n";
}
}
print '</tr></table>';
print closedir DIR;
print closedir DIR; will print 1 if closedir returns true.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.