in reply to RE: RE: Obtain matrix info
in thread Obtain matrix info

Perl has a real problem in that there are so many badly written CGI scripts around on the web and most people seem to pick up bad habits from them before finding places like perlmonks where they can get good advice. I'd be geniunely interested in hearing any ideas you have about how we can get to new Perl programmers and teach them good habits before they meet Matt Wright and his friends.

Your assumptions about CGI parameters are wrong. It is perfectly valid to have more than one value for each key. CGI.pm handles this by returning a list of values for multi-valued parameters. the older cgi-lib.pl handles it by returning a string where the values are separated by a \0 character. most hand-rolled solutions (like yours) handle it by trashing all but one of the values.

I apologise if my original post sounded too much like a flame. All I wanted to do was to point out that there are much better ways to do what you're doing and I hope that having been shown them, you will start to use them.

--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>

Replies are listed 'Best First'.
How to install CGI.pm
by sinan (Sexton) on Jul 30, 2000 at 15:18 UTC
    You are right; I saw that piece of code in one of Matt's scripts.

    You don't need to apologise; I am glad that you warned me. At some point, I would need to handle multiple selection boxes...

    In fact, I decided to use CGI.pm some time earlier, and I began with a code I saw at http://stein.cshl.org/WWW/software/CGI/ . But I got some error messages and I inferred that the CGI.pm library was not installed on my server. (I don't have root access.)
    I used
    use CGI qw(:standart)
    .
    May be you can help me out? Did I make a mistake? Thanks for your help!

    Edit kudra, 2001-07-18 Changed title to avoid clash with module

      CGI.pm has been a standard part of Perl for some years now (since 5.004_04 I think). If you have an earlier version than that then you'll need to get it installed (but if you have an earlier version than that on a web server then you have major security holes anyway).

      I'm assuming that it's a typo, but you have mis-spelt 'standard' in your sample above. Is that the problem?

      If you let me know what errors you're getting, then I'd be happy to help you track them down.

      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000, ICA, London
      <http://www.yapc.org/Europe/>
        No, that's just a typo...

        I looked at my previous files, I think I deleted the code when I failed to get it working. But when I try it a second time, I certainly will ask you if I get any problem like that.

        I don't know the Perl version, but I do not think it is and early version...
        Thank you very much.:-)
A reply falls below the community's threshold of quality. You may see it by logging in.