Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.

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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho