in reply to readdir() only returns one result when used with Fatal.pm
From this site:
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
On Thu, Mar 23, 2006 at 02:03:57PM +0100, Rafael Garcia-Suarez wrote: > Tom Hukins (via RT) wrote: > > Fatal.pm and readdir() do not play well together. Run the followi +ng > > script in a directory containing several files. It only prints ou +t '.'. > > Then comment out the 'use Fatal' line and run the script again. I +t 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 [at]subdir = readdir $dir; > > closedir $dir; > > print "@subdir\n"; >
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: readdir() only returns one result when used with Fatal.pm
by gellyfish (Monsignor) on Oct 06, 2006 at 21:30 UTC |
In Section
Seekers of Perl Wisdom