Msg#: 3179843 posted 1:17 pm on Dec 6, 2006 (gmt 0)
The error message is pretty clear: You have an unmatched ) symbol. You have to have the same number of open & close parentheses.
Now, I have no idea what the line in question is supposed to do, so I don't know how to balance it. Did you copy & paste it from somewhere, or did you write it yourself? If the latter, what exactly is it supposed to do? The =~ s/// syntax is for replacing some characters with other characters, but I'm a bit sleepy to try to interpret this particular use of it.
However this is the line were the problem is with error:
Unmatched ) in regex; marked by <-- HERE in m/[([^]]+) <-- HERE ]/ at data.pl line 259.
Essentially, I have a content management system for my site which was developed by someone else as my programming skills are limited. I'm a designer.
The addition of the line of code is to enable me to use $include[whateverfilename.html] in the site templates. The effect would be to act like a server side include and enable me to use a header and footer html file. For instance where ever i entered $include[header.htm] in the website templates, the content of header.htm would be included.
I can see the error is suggesting I'm missing a )but can't work out how to fix it.
Msg#: 3179843 posted 6:48 pm on Dec 6, 2006 (gmt 0)
the ']' is obviously a special character, it's the end of the character class. Adding the \ escapes it so perl treats it literally.
But shelling out to open the file qx(cat ""$1"") could probably be done in a better way using perls open() function. Using the shell is not efficient and certainly not portable. Write a sub rotuine that opens and prints the file or stores the file in a variable for printing later.