Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: how list all the files and directories?

by littlemonk (Sexton)
on Jan 06, 2014 at 19:01 UTC ( #1069570=note: print w/ replies, xml ) Need Help??


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";


Comment on Re^3: how list all the files and directories?
Download Code
Re^4: how list all the files and directories?
by LanX (Canon) on Jan 06, 2014 at 19:24 UTC
    > plz tell me wer im doing wrong

    well use strict and use warnings would show you that $dirname doesn't exist.

    what else do you think is "wrong" in the result?

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-07-28 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (186 votes), past polls