Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 May 19th, 2000, 02:45 AM
Cindy Cindy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 5 Cindy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello, please help me... I am so fedup to keep on having to edit html code inside .pl scripts, and I keep on making mistakes with the / and and the print command and on and on.

Therefore, I would like to know:

a) how can I implement into scripts a template include,
as Links does. I did already look inside the code but
did not understand.

b) is there perhaps a software out there which modifies
"normal" html code into perl (with the "printf" stuff)
on the fly?

Thank you very much indeed for your help!

Reply With Quote
  #2  
Old May 19th, 2000, 04:49 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
Cindy Hi,


you can escape from some characters using "" in perl.but most of the time it is very difficult to edit the html portion with this escape slash.

you can overcome this problem.
you can use qq().

eg:

print qq|

<html>
<head>
</head>

<body>
<h1>Test Message</h1>
</body>
</html>

|;


simply it will print the html file.


another way is that,

if you can use cgi.pm module you can simply type your html as following..


print <<EOF;
#just print the html

<html>
<head>
</head>

<body>
<h1>Test Message</h1>
</body>
</html>

EOF



------------------
SR -
shiju.dreamcenter.net

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #3  
Old May 19th, 2000, 04:54 AM
Cindy Cindy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 5 Cindy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx for your reply... and how can I manage to have separate .html files which the scritp will use as templates? As f.eg. LINKS (gossamer-threads) does?

thanx"!

Reply With Quote
  #4  
Old May 19th, 2000, 05:18 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>a)how can I implement into scripts a template include, as Links does.

option #1:
require "server_path/to/template_file";

option #2:
qq~
<html>
<body>
html codes here
</body>
</html>
~;

option #3:
print "Content-type: text/htmlnn";
print <<HTML_OUTPUT;
<html>
<body>
Hello World!
</body>
</html>
HTML_OUTPUT

b) is there perhaps a software out there which modifies "normal" html..
No.

#############################################
>>I keep on making mistakes with the / and and the print command

If you can't get thru this beginning stage of Perl or you just don't like it, then Perl is not for you.
Yes, you can jump right to my three options above immediately but if you really want to learn, you first need to be patient and figure out the syntax errors.
Likewise, Redhat users rely on GUI too much, they learn nothing in return. GUI is mainly for two kind of people: 1) ease of configuration and time consuming for people who know how to configure things manually
2) lazy to learn, just want to get things running ASAP.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Get rid of editing HTML code inside PL files

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap