Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

【PERL】Listing folders【BEGINNER】

Name: Anonymous 2009-12-10 18:52

I've been looking online and can only find example of listing items inside a folder. The only think I want to do is list folders inside a folder. How should I go about doing this?

Name: Anonymous 2009-12-10 19:17

if(-d $filename){
   #isdir
   print $filename;
}

Name: Anonymous 2009-12-10 19:29

$_{?}->@x[_()]&_:?;

Name: Anonymous 2009-12-10 19:34

>>3
VALID PERL CODE

Name: Anonymous 2009-12-10 19:44

I used this and it worked. Thanks bro.

#!/usr/bin/perl -Tw

use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";

my @files = <*>;

for (@files) {
    my $filename = $_;
    if (-d $filename) {
        #isdir
        print $filename;
    }
}

Name: Anonymous 2009-12-10 21:43

>>4
VALID PYTHON CODE

Name: Anonymous 2009-12-10 22:15

GLOB MY ANUS

Don't change these.
Name: Email:
Entire Thread Thread List