readdir question



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
.



Relevant Pages

  • Re: [PHP] Re: A general UL script
    ... I'm trying to validate wether or not to run the image check script. ... Posible to not add an empty field in the submit. ...
    (php.general)
  • Re: whats wrong with find -exec sed?
    ... but did the job faster than writing a script. ... But my first command still doesn't do what it is supposed to. ... files get completly empty now. ... Shouldn't there just be a switch in sed which does the trick? ...
    (alt.os.linux)
  • Re: Replace all script step - flakey?
    ... single step script with a replace statement which acts on the commish field. ... If you want records where BOTH Comm_Flag is empty AND GrandTotal is ...
    (comp.databases.filemaker)
  • Re: Enumerate Empty Global Groups
    ... Many thanks for your efforts, the script produced the exact results that I needed. ... You can use ADO to retrieve all ... > where the member attribute is empty. ... > Dim strBase, strFilter, strAttributes, strQuery, objRecordSet ...
    (microsoft.public.windows.server.scripting)
  • Re: [PHP] Re: A general UL script
    ... But that leaves me a bit off to how to tell the script to leave it alone. ... Posible to not add an empty field in the submit. ... Maby there is something else, ... stops when I check the array for actual images. ...
    (php.general)