Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-27-2010, 03:13 PM   #1
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Rep: Reputation: 30
passing perl variable into input tag in cgi script

How can I to pass a perl variable into html input tag?
For example, If a have got a cgi script:

use CGI;
use DBI;

my $owner = $cgi->param('owner');

print "<html>";
print "<form ...>";
print "<input type='hidden' name='profile' value=\"$owner\">";
print "</form>";
print "</html>";
How can I to pass $owner variable?
Old 08-27-2010, 07:13 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Your example code looks fine to me. What does the resulting HTML looks like? What doesn't do what you expect? Your use of quotes is a bit inconsistent, but I don't think this a cause of problems.

--- rod.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 05:11 AM
passing parameters from cgi script to html page shifter Programming 4 01-18-2010 11:26 AM
Calling perl script and passing variable from php script hosea Programming 5 10-21-2008 09:01 AM
Perl question: Passing variable into function rjcrews Programming 0 10-06-2006 10:24 AM
Passing a variable to a cgi script WindowBreaker Slackware 1 04-03-2006 11:02 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

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