in reply to readdir and while - magic?
why does ... work correctly, even for a filename like "0" that evaluates to false in boolean context?Because it really looks like this under the hood
This is a DWIM perlism, nifty huh? I think it applies to any assignment in a while statement where the result of the assignment is evaluated for the condition, or something along those lines.opendir(D, "test"); while ( defined( $file = readdir(D) ) ) ...
_________
broquaint
|
|---|