in reply to Re: strict
in thread strict problem

1) I will take a serious look at CGI - thanks for the pointer!

2) ok, I'll remember - I just didn't want to flood this forum for a question that seems as trivial as this one.

3) 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.

Replies are listed 'Best First'.
Re: Re: Re: strict
by hossman (Prior) on Mar 20, 2002 at 17:53 UTC
    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.

      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... :)