Hi,

this is a working code snippet:

opendir (DIR, $dir) || die "Open failed: $!\n";

$\ = "\n";
while ($_ = readdir(DIR)) { print; };

But when I try to use

while (readdir(DIR)) ...

my script writes only empty lines. It seems that the proper number of
empty lines are written. Does the prepended $_ change readdir's
calling context? Or any other explanation?

- Gergely

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to