coolboarderguy has asked for the wisdom of the Perl Monks concerning the following question:
been away from Perl for a long time, and am back learning it. I just did a tutorial example, below,
and I ran the code as,#!/usr/bin/perl use strict; use warnings; sub processFiles { my $path = shift; opendir (DIR, $path) or die "Unable to open $path: !"; my @files = grep { !/^\.{1,2}$/} readdir (DIR); closedir (DIR); foreach my $myfile (@files) { print "Files: $myfile\n"; } }
./direcur .
in a dircetory containing 3 files, and expected the code to return the file names, but, got no output. Any pointers, as I got no errors when running it? Cheers.
coolboarderguy...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: No Filenames Returned
by Corion (Patriarch) on Mar 23, 2006 at 08:32 UTC | |
by coolboarderguy (Acolyte) on Mar 23, 2006 at 08:54 UTC | |
by Corion (Patriarch) on Mar 23, 2006 at 09:13 UTC | |
by coolboarderguy (Acolyte) on Mar 23, 2006 at 11:17 UTC | |
by bowei_99 (Friar) on Mar 23, 2006 at 09:24 UTC | |
by coolboarderguy (Acolyte) on Mar 23, 2006 at 11:41 UTC | |
|
Re: No Filenames Returned
by wulvrine (Friar) on Mar 23, 2006 at 12:17 UTC |