Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl5/perl
    
  2. or download this
    #!/usr/bin/perl5/perl -T
    use strict;
    use warnings;
    use diagnostics;
    
  3. or download this
    #!/usr/bin/perl5/perl -wT
    use strict;
    use diagnostics;
    
  4. or download this
    &get_form_data;
    
  5. or download this
    use CGI qw/:standard center/;
    
  6. or download this
    print "Content-type: text/html\n\n";
    
  7. or download this
    opendir(DIR, "./Data");
    while($name = readdir(DIR))
    ...
     push(@files, $name);
        }
    close(DIR);
    
  8. or download this
    opendir(DIR, "./Data");
        while( $name = readdir(DIR) ) {
    ...
            push(@files, $name);
        }
    close(DIR);
    
  9. or download this
    opendir (DIR, "./Data") || die "Couldn't open directory ./Data: $!";
    
    OR:
    
    opendir DIR, "./Data" or die "Couldn't open directory ./Data: $!";
    
  10. or download this
        while( $name = readdir(DIR) ) {
            next if $name !~ /^\d*.html/;
            push(@files, $name);
        }
    
  11. or download this
        my @files
        while( my $name = readdir DIR ) {
            next if $name !~ /^\d*.html/;
            push(@files, $name);
        }
    
  12. or download this
        my @files
        while( readdir DIR ) {        
            push @files, $_ if /^\d*.html/;
        }
    
  13. or download this
    closedir(DIR) || die "Couldn't close directory './Data': $!";
    
    OR:
    
    closedir DIR or die "Couldn't close directory './Data': $!";
    
  14. or download this
    my $next_file = 'testing.html';
    
  15. 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': $!";;
    
  16. or download this
    push(@files, $nextfile);
    print "<HTML>\n<BODY>\n";
    ...
    }
    print "</BODY>\n</HTML>\n";
    exit;
    
  17. or download this
    push @files, $nextfile;
    
    ...
    print end_html;
    
    exit;
    
  18. 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;