PERL can't read contents of directory.
Hi,
here is the code Code:
Thanks |
1. use opendir : http://perldoc.perl.org/functions/opendir.html
In Unix things look like files, but a dir not same as a file 2. When using open, close, opendir, closedir, always use opendir(DIR, $DIRNAME) or die "cant open $DIRNAME: $!"; $! = error msg supplied by Perl Always use warnings and strict eg #!/usr/bin/perl -w use strict; # Enforce declarations they'll save you a lot of stress later. You can syntax check a prog without running it using perl -wc file.pl |
All times are GMT -5. The time now is 07:04 PM. |