in reply to Re^2: how list all the files and directories?
in thread how list all the files and directories?
plz tell me wer im doing wrong
$path="D:/Chanti"; opendir ( DIR, $path ) || die "Error in opening dir $dirname\n"; #//print "directory contains-->@arr"; while($filename=readdir(DIR)){ print "$filename"; if (-f $filename){ push(@file,$filename); } if (-d $filename){ push(@dir,$filename); } } print "Directory--->@dir\n"; print "\n";print "\n";print "\n";print "\n";print "\n";print "\n"; print "File---->@file\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: how list all the files and directories?
by LanX (Saint) on Jan 06, 2014 at 19:24 UTC |
In Section
Seekers of Perl Wisdom