Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
sub index { #&top_nav; &weather; &date; #read in template page for INDEX.HTML################################# +###### my $templateFileIndex="../../htdocs/temp_test/ia_index.html"; open(INFILE,"<$templateFileIndex"); my @templatePageIndex=<INFILE>; close(INFILE); #condense page array into one scalar variable my $tIndex=join("",@templatePageIndex); #search-and-replace on date, nav bar and variables $tIndex=~s/%%INSERT DATE HERE%%/$liveDate/g; #$tIndex=~s/%%BLURB%%/$blurb/g; #$tIndex=~s/%%AGENT_NAME%%/$agent_name/g; #$tIndex=~s/%%URL%%/$url/g; $tIndex=~s/%%WEATHER%%/$weather/g; $tIndex=~s/%%WEATHER2%%/$test/g; #tIndex=~s/%%INSERT NAV HERE%%/$navPage/g; #done, output page to browser print $tIndex; exit } ###################################################################### +###### sub weather { # read in footer template $foot='weather/weather.cgi'; open(MYFOOT,"<$foot"); @footerPage=<MYFOOT>; close(MYFOOT); #condense page array into one scalar variable $weather=join("",@footerPage); $test="Test Variable"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Code
by BrowserUk (Patriarch) on Sep 17, 2002 at 19:15 UTC | |
by Anonymous Monk on Sep 17, 2002 at 19:34 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2002 at 19:42 UTC | |
by Anonymous Monk on Sep 17, 2002 at 20:10 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2002 at 20:28 UTC | |
by fglock (Vicar) on Sep 17, 2002 at 19:46 UTC | |
by Anonymous Monk on Sep 17, 2002 at 20:16 UTC | |
|
Re: Parsing Code
by Aristotle (Chancellor) on Sep 17, 2002 at 21:43 UTC |