Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to access an unknown number of CGI variables in a CGI script

by space_monk (Chaplain)
on Jan 08, 2013 at 09:56 UTC ( #1012210=note: print w/replies, xml ) Need Help??


in reply to How to access an unknown number of CGI variables in a CGI script

Here you go...
use strict; use warnings; use CGI; # do some other stuff..... # either functional style... my @students = param('student[]'); # OR OO-style... my $query = CGI->new; my @students = $query->param('student[]'); # OR Gangnam-style..... # no just kidding :-) # now process your student input, # remember to check no one is sending you weird data ..... foreach my $student (@students) { # wibble }
A Monk aims to give answers to those who have none, and to learn from those who know more.
  • Comment on Re: How to access an unknown number of CGI variables in a CGI script
  • Download Code

Replies are listed 'Best First'.
Re^2: How to access an unknown number of CGI variables in a CGI script
by prautt (Initiate) on Jan 08, 2013 at 16:56 UTC
    Thanks much! Is it possible to do it without using CGI.pm?

      Thanks much! Is it possible to do it without using CGI.pm?

      Sure, why do you ask?

        Well, I haven't used CGI.pm in my script. I can use it if I need to, but I'm wondering if it's possible to accomplish the above without the use of CGI.pm? Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012210]
help
Chatterbox?
[shmem]: some experience with vim?
[Lady_Aleena]: None
[shmem]: I don't know geany, and don't know whether it has support for ctags.
[Lady_Aleena]: ctags?
[shmem]: ctags is a program which (recursively) extracts the symbols from source and stores them in a one-file database. This allows you to query the locations where these symbols (e.g. a subroutine name) are used anywhere in the source code tree...
[shmem]: ...from inside the editor.
[shmem]: apt-get install exuberant-ctags
[Lady_Aleena]: I think I heard vim has a big learning curve.
[shmem]: then in the root of your source tree run: ctags -R
[shmem]: you get a file named tags where all symbols and the places where they are used are listed

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-04-27 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (505 votes). Check out past polls.