- or download this
#!/usr/bin/perl5/perl
- or download this
#!/usr/bin/perl5/perl -T
use strict;
use warnings;
use diagnostics;
- or download this
#!/usr/bin/perl5/perl -wT
use strict;
use diagnostics;
- or download this
&get_form_data;
- or download this
use CGI qw/:standard center/;
- or download this
print "Content-type: text/html\n\n";
- or download this
opendir(DIR, "./Data");
while($name = readdir(DIR))
...
push(@files, $name);
}
close(DIR);
- or download this
opendir(DIR, "./Data");
while( $name = readdir(DIR) ) {
...
push(@files, $name);
}
close(DIR);
- or download this
opendir (DIR, "./Data") || die "Couldn't open directory ./Data: $!";
OR:
opendir DIR, "./Data" or die "Couldn't open directory ./Data: $!";
- or download this
while( $name = readdir(DIR) ) {
next if $name !~ /^\d*.html/;
push(@files, $name);
}
- or download this
my @files
while( my $name = readdir DIR ) {
next if $name !~ /^\d*.html/;
push(@files, $name);
}
- or download this
my @files
while( readdir DIR ) {
push @files, $_ if /^\d*.html/;
}
- or download this
closedir(DIR) || die "Couldn't close directory './Data': $!";
OR:
closedir DIR or die "Couldn't close directory './Data': $!";
- or download this
my $next_file = 'testing.html';
- or download this
open OUT, ">Data/$nextfile" or die "Cannot open 'Data/$nextfile': $!";
print OUT
...
end_html;
close OUT or die "Cannot close 'Data/$nextfile': $!";;
- or download this
push(@files, $nextfile);
print "<HTML>\n<BODY>\n";
...
}
print "</BODY>\n</HTML>\n";
exit;
- or download this
push @files, $nextfile;
...
print end_html;
exit;
- or download this
#!/usr/bin/perl5/perl -T
use strict;
...
print header, start_html( -title => 'File Listing');
print a({ -href => "Data/$_" }, $_ ), br for @files;
print end_html;