Forum Moderators: coopster & phranque

Message Too Old, No Replies

Upgrading Embperl, weird error of course

syntax error at MEM:MEM:

         

timster

4:02 pm on Jan 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been tasked with upgrading the Embperl module on our mod_perl site from 1.3.6 to the current, 2.2.0.

I've installed Apache::SessionX and configured it to use DB files (because this seemed like it would be the simplest test).

The install went OK after a few hiccups, but when I switch the pages to us the new Embperl (change HTML::Embperl to just Embperl) I get the following errors in the logs:

[20481]ERR: 24: Error in Perl code: syntax error at MEM:MEM: line 27, at EOF
[20565]ERR: 24: Error in Perl code: syntax error at MEM: line 25, at EOF
[20565]ERR: 24: Error in Perl code: syntax error at MEM:MEM: line 27, at EOF
[21067]ERR: 24: Error in Perl code: syntax error at MEM: line 25, at EOF
[21067]ERR: 24: Error in Perl code: syntax error at MEM:MEM: line 27, at EOF
[21068]ERR: 24: Error in Perl code: syntax error at MEM: line 25, at EOF
[21068]ERR: 24: Error in Perl code: syntax error at MEM:MEM: line 27, at EOF
[Wed Jan 10 10:44:18 2007] [error] [21566]ERR: 24: Error in Perl code: Can't call method "pid" on an undefined value at? line 3.
[Wed Jan 10 10:44:18 2007] [error] [21566]ERR: 24: Error in Perl code: Missing right curly or square bracket at? line 164, at end of line\nsyntax error at? line 164, at EOF
[Wed Jan 10 10:44:18 2007] [error] [21566]ERR: 24:?(1): Error in

Neither I nor Google seems to know much about syntax errors at MEM:MEM. I'm guessing it's dynamic code stored in memory?

Any help is appreciated. I'm pretty stumped at this point.

timster

4:11 pm on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, I've learned a bit about this myself, but am still having problems here.

The errors in my OP are apparently not caused by a configuration problem with Embperl 2, but by the fact that Embperl handles files differently. A lot of out existing template files are throwing errors, for reasons including:

- By default, Embperl 2.2, validates HTML for well-formedness, so was getting errors about tags in the wrong place. But this functionality can be [turned off¦http://www2.ecos.de/~mailarc/embperl/2005-09/msg00051.html]

- Variable scoping inside [* *] tags works differently. Namely, we were getting errors that lexical variables were being redefined in the same scope. (That looks like the template files will just need to get fixed.)

- The time that Embperl sends its output seems to have changed. Under 1.0, sub-templates included in the middle of the page-template would be output in the order they appeared. Now they are appearing at the top. Apparently, Embperl is sending its output upon completely parsing the template.

Changing this last behavior would help a lot. I've been Googling for the Embperl 2 equivalent to $¦=1, without success.

Anyone?

timster

7:56 pm on Jan 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I reckon I ought to finish this thread up then.

In older versions of Embperl you could flush the output of the buffers to screen, but Embperl 2 doesn't allow that. The site was calling Embperl directly from inside Embperl files, and that caused a problem in the order the files were output. We'll have to replace those calls with [+ +] tags.

In short, Embperl 2 seems to be a lot stricter as to what it will accept than version 1.

physics

6:25 pm on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for following up timster!