in reply to Re: Re: strict
in thread strict problem

I know cgi-lib returns a hash, sorry - I was just playing around with everything, and got a bit confused because of the late hour.

Go re-read the docs (or i should say: go re-read the examples & source since cgi-lib.pl is so horribly documented)...

# Returns >0 if there was input, 0 if there was no input # undef indicates some failure.

It doesn't return a hash, or an array.

Replies are listed 'Best First'.
Re: Re: Re: Re: strict
by Anonymous Monk on Mar 20, 2002 at 18:32 UTC
    if (($in{'pic'} =~ /^[a-z0-9-_]+\.jpg$/i) && ($in{'cat'} =~ /^[1-7]$/) +) { &showPic($in{'pic'}, $in{'cat'}); } elsif ($in{'cat'} =~ /^[1-7]$/) { &showCat($in{'cat'}); } else { &showError; }

    Hmm... That is a hash, isn't it?

    Doh... Ofcourse I can't use the return value of the function, since it's just that - a scalar. Anyway, I use the hash %in that's defined in the function itself, it caries all keys and values.

    The script itself works, I've been using it this way in several websites... I just really want to start using strict and get a better understanding of it all, instead of just 'making it work'.

    Ofcourse, that doesn't mean that it shouldn't work... :)