Miniscule Job - Easy Script
Doug Anarino
doug at provincetown.com
Tue Aug 10 11:47:29 CDT 1999
Hi,
Provincetown.Com is struggling with Intershop (an ecommerce app) and
is in need of a super simple PERL script to plug into its Server Side
Scripting functionality.
Someone familiar with PERL could write this in their sleep, so the
job's not going to amount to much of an invoice. But we'll probably
have quite a bit of work coming up this fall as we try to wean
ourselves off of Intershop and port our content management system to
PERL. We'd love to make contact now with someone who could do this
work in future.
So, if anyone's interested in helping us out, here's what the script
needs to do:
It's essentially a text parsing problem. The script needs to go
through a string and find keywords (all starting with the # symbol)
and send them as parameters to another script and print out the
returned value. I said this was really simple!!
This string is going to contain html and keywords that need to be
expanded into more html. An example: "Merchant Name: #MerchantName".
The character just after the keyword name could be white space, but
it could also be a single/double quote, or the start of a tag (<).
What is this for? Intershop holds its template variables in user
definable 'TLEs'. One limitation to these TLEs is that they can't
contain other TLEs. I really need to be able to do this! My
workaround is to use Intershop's ability to embed PERL scripts into
the templates. The script will take the name of a TLE variable, grab
its value and then expand any TLEs it finds inside using Intershop's
built in functions. I don't necessarily need unlimited recursion
(being able to put a TLE into a TLE which is in another TLE, etc.) if
this slows things down or makes them cumbersome.
Psuedocode for what I have so far:
sub expandTLE(tleName)
{
$tleValue = getTLE(tleName); ## call intershop's get function
LOOP (tleValue) using # as separator
{
addContent(stuff before #); ## call intershop's write function
addContent(getTLE(name of this tle)); ## wrie out the value
}
}
As you can see, the problem is that I don't know how to loop through
this string and find the TLEs and extract their names for expansion.
I could do something really clunky, but I'll bet someone here knows
of a better solution.
Thanks for your attention,
doug
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. Provincetown Design Group & www.provincetown.com .
. Doug Anarino tel: 508-487-7733 .
. doug at provincetown.com fax: 508-487-5199 .
. 336 Commercial Street #10 Provincetown, MA 02657 .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
More information about the Nyc-perl-jobs-pm
mailing list