Hi!
On Mon, Mar 25, 2002 at 03:02:33PM +0000, Chris Allen wrote:
> Subject: Why no semicolon at the end of lines?
For speedup reasons there is only one statement allowed inside Embperl
2.x's [+ +] blocks. In Embperl 1.x, there was allowed more than one
statement.
> Our main ISP just upgraded their Embperl to 2.0b4 without telling
> us - :-( Unfortunately, nearly all our code is in the form:
>
> [+ some_statememt(); +]
>
> so it breaks because of the semicolon. We have thousands of lines of
> web site code that don't work now!
>
> Is there an easy workaround (option???) to turn off this problem with
> a semicolon at the end of a line? I don't mind if things run slow -
> I would just like them all to run!!
If it's 2.0b4 (but not 2.0b6 or later), try to set
PerlSetEnv EMBPERL_EP1COMPAT 1
at the top level of your httpd.conf, then Embperl 2.0b4 should just
behave the same like Embperl 1.3b7.
But usually you should use this one a production machine, because it
isn't tested as good as 1.3b7 itself.
And please remember, that the Embperl 1.x compatibility mode has
disappeared in 2.0b6 (because it isn't needed anymore because of a
name space change), so that this fix won't work anymore, if your ISP
updates to 2.0b6 or later.
Other methods, which work, but need to change all files with
semicolons inside [+ +]:
+ If there is a single statement inside [+ +], just remove the
semicolon, e.g. with perl inline edit, e.g. something like
perl -pe 's/;\s+\+\]/ +]/g;' -i *.epl
to change all files at once. (Be careful, perl -i can destroy a lot.)
+ Else if you have more than one statements inside a [+ +] block,
surround everything with a do { ... } block.
See also the README.v2 of your Embperl version. E.g. the README.v2 for
Embperl 2.0b5 (and earlier) is available at
ftp://ftp.dev.ecos.de/pub/perl/embperl/2.0-alpha/README.v2
and the README.v2 for Embperl 2.0b6 and later is available at
ftp://ftp.dev.ecos.de/pub/perl/embperl/README.v2
HTH.
Regards, Axel Beckert
--
-------------------------------------------------------------
Axel Beckert ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice: +49 6133 926530
WWW: http://www.ecos.de/ Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]