Re: $File::Find and no_chdir
- From: rvtol+news@xxxxxxxxxxxx (Dr.Ruud)
- Date: Sat, 29 Sep 2007 19:26:02 +0200
schms schreef:
opendir DH, $DIR or die "Cannot open '$DIR' $!";
print map "$DIR/$_\n", readdir DH;
closedir DH;
Looks very 'global variables' oriented to me.
Compare to:
{ opendir my $dh, $dir
or die "Cannot open '$dir': $!";
while (my $e = readdir $dh) {
$e = "$dir/$e";
-d $e and $e .= "/\t<--";
print "$e\n";
}
closedir $dh; # no need, is implicit
}
--
Affijn, Ruud
"Gewoon is een tijger."
.
- References:
- $File::Find and no_chdir
- From: Schms
- Re: $File::Find and no_chdir
- From: Paul Lalli
- Re: $File::Find and no_chdir
- From: Schms
- $File::Find and no_chdir
- Prev by Date: Re: strict behavior with .pm
- Next by Date: Re: Strange debugging question...
- Previous by thread: Re: $File::Find and no_chdir
- Next by thread: Re: ::Find and no_chdir
- Index(es):
Relevant Pages
|