tags:

views:

55

answers:

3

I'm using a third-party ecommerce search provider, but we're hosting the template files so we can modify them as needed.

Our website is running off of Perl, which is having trouble handling this template tag:

[--NEW_ROW--]

How would I go about escaping or commenting that line out, so the third-party tool could still process it, but Perl wouldn't choke on it?

+1  A: 

Perl executes the template file, which is not written in Perl, as code? That design is amazing​…ly stupid.

You can try to put # in front of it to turn it into a comment.

daxim
Agreed. I tried this, but the server is still throwing errors.#[--NEW_ROW--]We ended up just disabling Perl with htaccess:<Files "*.html"> SetHandler text/html</Files>
Chris Fletcher
+1  A: 

If it's parsing -NEW_ROW- as Perl because it's between [- and -], does changing the string to [-#-NEW_ROW--] help? I know you've already come up with a solution, but if you want to throw .html files through the parser in the future, this might fix it.

CanSpice
I can confirm that this works.
Chris Fletcher
+1  A: 

If your perl template handling runs before your third-party template handling, and you cannot change one of them to use non-conflicting tags, try something like this:

[- print "[--NEW_ROW--]"; # This is an admittedly horrible bodge.  Ask Chris about it. -]

Whatever you do, don't remove that comment. :)

pilcrow
This didn't work for me, but might for someone who's using a site built in this millennium.
Chris Fletcher