in reply to Re: Running external program until N files created
in thread Running external program until N files created

You may want to make that:     last if $files >= $N; or even     last if ++$files >= $N while readdir DIR; Otherwise, the directory could jump from <N to >N files and your script would miss it.

Replies are listed 'Best First'.
Re: Re: Re: Running external program until N files created
by japhy (Canon) on Mar 02, 2001 at 02:50 UTC
    Hmm, good point. Oh, but your second snippet is broken (since Perl doesn't allow multiple post-expression control modifiers).
    ++$files >= $N and last while defined readdir(DIR);
    And keep that defined in there. The files "0" and "" are valid, you know.

    japhy -- Perl and Regex Hacker