LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-28-2008, 02:00 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How to program the CGI module in Perl (newbie question)


Hi,
If I want the parameters in an HTML form to be put into an array in Perl,can I do this?:

my (@param) = $cgi->param("firstname","lastname","flat", "street", "city","state","country") ;
 
Old 11-29-2008, 11:30 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
First, I would argue against using param as the name of the array.
Second, I would always use the -T option with CGI scripts.
Third, have you tried it? and if so does it work?
Code:
my (@list_params) = $cgi->param("firstname","lastname","flat", "street", "city","state","country");
 
Old 12-01-2008, 01:29 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
What does -T do?

No, I haven't yet tried it (the inputting webpage hasn't been made yet), I was hoping to get an answer here before I do
 
Old 12-01-2008, 02:08 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
SAMS Teach Yourself Perl in 24 Hours
Quote:
The -T switch on the #! line enables data tainting. As data is received from external sources-filehandles, network sockets, the command line, and so on- it's marked as tainted. Tainted data cannot be used in backticks, system calls (such as open), the system command, or other places that might compromise your security.
This is basically there to stop people passing commands as a part of the data, for example:
Code:
Data; cat /etc/passwd
or:
Code:
$(rm -rf /)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl/CGI uploader program - temp file not getting deleted anroy Programming 4 09-13-2006 02:33 AM
How to Call a C program from Perl CGI Script anoop_cn Programming 1 05-11-2004 04:37 PM
Total Newbie... Perl program install help for CGI::KWIWI futuremed Linux - Newbie 0 02-29-2004 11:14 AM
Executing a program on server using CGi/PERl ?! avios Red Hat 1 12-29-2003 02:34 AM
Gtk gui on a cgi perl program bruce1271 Linux - Software 2 12-08-2003 05:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration