Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 29th, 2000, 03:35 PM
tbonds
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Is there a good web reference on how to use HTML properly when printing the various form tags as output? For example, print "<b>Hello World.</b>n"; is no problem. However, using print "<FORM blah, blah, blah></FORM>n"; is a problem. Do form elements need to be coded syntactically different than their simpler hmtl bretheren? My Perl references don't seem to cover this.

Thanks,

Reply With Quote
  #2  
Old November 29th, 2000, 03:57 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
<form> tags are coded the same way all other tags are coded. You place the <form> element around other elements which are then called the form "controls". Those controls are what you use to write a message at this forum. So to code a simple <form> tag in Perl you could use something like this:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
print "<form name="form1" action="script.pl" method="post">n";
[/code]

Or you can always use the CGI.pm module and its HTML shortcuts...

Reply With Quote
  #3  
Old November 29th, 2000, 05:33 PM
tbonds
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Ahhh, I don't think I was escaping my quotes in the form code when I tried to print them! Perl generated some type of "illegal divide by zero on line x" message when I tried to run my script at the command line. Don't know what that meant, but maybe the lack of escapes had something to do with it. Anyway, thanks for your example. I'll give it a try.

Regards,


Reply With Quote
  #4  
Old December 4th, 2000, 09:58 PM
Wefrucar Wefrucar is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 2 Wefrucar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just a little tip: use the qq() URL

It's not a very known code, but quite handy. It ignores all quotes within it.
You could do something like:

print "qq(<form name="name" action="get.cgi" method="post"> )");

That would work.... I'm actually not sure how to use that code, since I use it so rarely.... but experiment a bit with the qq() function and you'll figure out how to use it URL

Reply With Quote
  #5  
Old December 5th, 2000, 02:30 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Just use it like this:
print qq(code);

Its one great function for HTML...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > HTML forms and Perl "print" statement


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT