| |||||||||||
| |||||||||||
wats wrong in this expression Posted by revtopo (revtopo), 27 August 2007 hi there,I have to write a set of codes in perl using shell scripts. the code that i have to insert in the file is perl -pe 'print q{ [% IF template.name.match('\.(css|js|txt)');debug("Passing page through as text: $template.name"); content; ELSE; debug("Applying HTML page layout wrappers to $template.name\n"); content WRAPPER site/html + site/layout; END;-%]} if $.==4' -i Topo/root/lib/site/wrapper.pm the code works on getting the name wrapped. I have been gettin a syntax error in the line [% IF template.name.match('\.(css|js|txt)'); syntax error near unecpected token. Is that any thing to do with \. in the code.? thanks in advance. Posted by admin (Graham Ellis), 27 August 2007 The ' within the code is being taken as the shell string terminator. I would suggest you save the Perl program in a file and run it from the file rather than trying to write an entire program on one command line ![]() This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |