in reply to Re: How to read files in a directory, directory path to be given through CMD
in thread How to read files in a directory, directory path to be given through CMD

C:\Perl64\bin>perl t1.pl Enter path: C:\Perl64\bin Undefined subroutine &main::find called at t1.pl line 18, <STDIN> line 1. :( While I got the solution :
$dir =<>; chomp($dir); opendir DIR, $dir or die "cannot open dir $dir: $!"; my @file= readdir DIR; print @file; closedir DIR;
UPDATE: I tried with almost all the codes and most of them are working fine along with what I have pasted here. But the issue is that for some complex path it's not working.
  • Comment on Re^2: How to read files in a directory, directory path to be given through CMD
  • Download Code

Replies are listed 'Best First'.
Re^3: How to read files in a directory, directory path to be given through CMD
by stevieb (Canon) on Jun 11, 2012 at 19:22 UTC

    Post the contents of the script. My 'find' line is on line 18, not 23.