August 26th, 2000, 06:20 AM
My previous post didn't make much sense when i read it afterwards, so i rewrote it:
What i need is a script that reads a file, searches for a & and takes the first word which comes after it and puts that word in a variable.
(This is part of the template)
After script is run a variable should contain
the string: ImageLogoLocation
Thanks in advance
August 26th, 2000, 12:57 PM
I can't really help you, but the "Perl Cookbook" from O'Reily is a great book with practical perl examples. If you want to make a great $40.00 investment I would suggest this book. It has information on template parsing.
August 26th, 2000, 02:26 PM
I can suggest general aproach.
1. You need define rule for parsing your template. And use appropriated mechanism to seaching positions for substitutions and making it (If you have decided to seach '&' as start position what will define the end of string for substitution, this is the full name of variable).
2. Read template, look for strings for substitution, fill out requred position.
(You can use Hash, database, etc for storing and getting desired value of desired variable)
3. Print to stdout (in your case clients webpage) the strings with concatanating of initial static contents and filled by values variables.
Hope it helps.
One of other general aproachs is to invite somebody to write script.
August 26th, 2000, 04:22 PM
Thanks for your ideas. I think i'll look into perl regular expression tutorials
October 20th, 2000, 06:26 AM
Try the HTML::Template module.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by d0g1e:
Thanks for your ideas. I think i'll look into perl regular expression tutorials [/quote]
October 21st, 2000, 01:39 AM
I like the way everybody dodged the question there
for <img src="&ImageLogoLocation">:
Would print "ImageLogoLocation"