jesuashok has asked for the wisdom of the Perl Monks concerning the following question:
Hi all
Fatal.pm and readdir() do not play well together. Run the following script in a directory containing several files. It only prints out '.'. Then comment out the 'use Fatal' line and run the script again. It now prints out all the files in the directory.
#!/usr/bin/perl use strict; use warnings; use Fatal qw(readdir); my $start_dir = '.'; opendir(my $dir, $start_dir); my @subdir = readdir $dir; closedir $dir; print "@subdir\n";
"Keep pouring your ideas"
2006-10-07 Unapproved by planetscape once evidence of habitual plagiarism uncovered.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: readdir() only returns one result when used with Fatal.pm
by diotalevi (Canon) on Apr 11, 2006 at 04:18 UTC | |
Re: readdir() only returns one result when used with Fatal.pm
by Tomte (Priest) on Apr 11, 2006 at 09:19 UTC | |
Re: readdir() only returns one result when used with Fatal.pm
by codeacrobat (Chaplain) on Apr 11, 2006 at 06:34 UTC | |
by demerphq (Chancellor) on Apr 11, 2006 at 11:52 UTC | |
Re: readdir() only returns one result when used with Fatal.pm
by liverpole (Monsignor) on Oct 06, 2006 at 11:14 UTC | |
by gellyfish (Monsignor) on Oct 06, 2006 at 21:30 UTC | |
Re: readdir() only returns one result when used with Fatal.pm
by ambrus (Abbot) on Apr 11, 2006 at 11:54 UTC |
Back to
Seekers of Perl Wisdom