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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 3rd, 2001, 04:15 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am going to re-design URL

At present, the site consists of about 25 different html files© Each of those 25 files has a significant amount of the same information on it such as the menu ¥which sucks, but is being redone¤©

I've noticed that it is a real pain in the *** if I want to change something in the menu, or make a table wider on each page because I have to edit 25 files©

I was thinking I could do the page with perl and that way it would be far easier to update things site wide©

I was wondering if perl is what I should use for doing something like this©

I thought I would do something like store the data for each of the individual pages in a file and then open a file when needed so that my perl script isn't 200k +

I realize that it would probably be best if I stored the info in a database, but I don't have ANY database experience right now, so that won't work© I would however like to eventually move to a database© What should I keep in mind to make it easy for me to change my site to use a database later?


Thanks for reading

Reply With Quote
  #2  
Old February 4th, 2001, 07:23 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
You could do it with Perl and a template based approach. Basically, you can have a HTML page which is dinamically created with data from an outer source (database, flat file, whatever).

But I personally think that you would do this far easier in PHP using its include() and require() functions. Basically, you could place the menu in a separate HTML file, and then use the following code on top of each page:
Code:
<?php
include("menu.html");
?>

Its all up to you really. Template based approach has its advantages, but I think that the PHP way is far easier.

HTH.

P.S.: Site looks cool. I hope the new menu is as cool...

Reply With Quote
  #3  
Old February 4th, 2001, 08:34 AM
dstaver dstaver is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Norway
Posts: 0 dstaver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I don't know which development tools you're using to create your pages, but I frequently use Dreamweavers built-in templating system for small projects where the amount of pages doesn't exceed 30-40. The advantage of doing it this way is that you won't need a database for storing you pages, and you get to see the page as it was meant to look like while you're working on it.

Reply With Quote
  #4  
Old February 4th, 2001, 04:58 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
Yes, but I think the man wanted something dynamic, so...

Reply With Quote
  #5  
Old February 4th, 2001, 05:41 PM
slacker_x slacker_x is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 slacker_x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the input© Regarding development tools, I'm just using a text editor© Programs like dreamweaver just don't help me much anymore because I know pretty much all the html tags©

just as an example, my friend used frontpage to make a really basic webpage© I was over there one time and I decided to view the source© All over the place there were references to fonts that most people wouldn't even have and the page would be broken in pre 6 versions of netscape because of the way the images were positioned©©©©©

The short version of the story is I re-wrote the page with notepad© The html file was almost 20 times smaller©©©©©©no joke and it looked better and it is compatble with older browsers©

I actually thought of PHP a little bit after I posted the initial message© I didn't know much about it, so I did a little reading, and for what I am doing it looks like a better solution© I have also heard that accessing databases is simpler using php than perl©

Reply With Quote
  #6  
Old February 5th, 2001, 11:22 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
Quote:
Originally posted by slacker_x
The short version of the story is I re-wrote the page with notepad© The html file was almost 20 times smaller©©©©©©no joke and it looked better and it is compatble with older browsers©


Err...Dreamweaver and FrontPage are two different things. I confess that Dreamweaver will sometimes make clutter in your source, but most (99% actually) of the time it will create decent and clean code which will render just fine in older browsers. So don't dismiss it.

On the other hand, hand-coding is still the best way to gain maximum performance.

Quote:
I actually thought of PHP a little bit after I posted the initial message© I didn't know much about it, so I did a little reading, and for what I am doing it looks like a better solution© I have also heard that accessing databases is simpler using php than perl©


Well, it just depends on what you mean by "easy". But for a beginner it can be easier to comprehend that Perl, especially since, in order to use DBI (the Perl interface to databases) you need to be comfortable with some advanced Perl stuff such as references, and so on. But for what you need to do, PHP is perfect. Just put the include() function on top of each page, and you will have the menu on each of your pages. Of course, if you need to change anything, you will have to change just one file!

So, for something this small, use includes and PHP. If your site gets bigger, start thinking about some database.

Reply With Quote
  #7  
Old February 10th, 2001, 08:53 AM
Adrian2 Adrian2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: London, England
Posts: 251 Adrian2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Server-side includes

Think 1996... think Server-Side Includes!

The average web host is far more likely to run SSI than PHP. Of course, if you've got PHP, go for it!

If not, ask your hosting company if they run SSI. If they run Perl/CGI, they'll almost certainly run SSI.

Just put your HTML menu code in a file and put this:

<!--#include file="menu.html" -->

or

<!--#include virtual="/path/to/your/file.html" -->

in your HTML file where you want the menu to appear. You'll have to save your new HTML file with the extension .shtml or sometimes .shtm or .stm. Find out which extension your server uses.

There's a good SSI tutorial at http://library.thinkquest.org/15074/ssimain.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Is perl what I want???


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 6 hosted by Hostway