in reply to Re: using WWW::Mechanize with loops
in thread using WWW::Mechanize with loops

Hi.

One file at a time would be a drag because after each submissions I need to click an email verification link. So I'd have to do some 400 email clicks instead of 1/6 of that submitting full forms.

Can you explain what my $num_to_submit = ( @files > 6 ? 6 : @files ); Is doing?

Replies are listed 'Best First'.
Re^3: using WWW::Mechanize with loops
by moklevat (Priest) on Mar 14, 2006 at 14:26 UTC
    In this context @files returns the number of elements in the array @files. This ternary operator expression (@files > 6 ? 6 : @files) works like this:

    my $number_to_submit=@files; if @files > 6 then $number_to_submit = 6; else $number_to_submit = @files;

    So this limits the number of files to submit to 6 if there are more than 6 files in the array @files.