perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: emperl can't invoke CODE refs?
Date Mon, 09 Sep 2002 07:21:06 GMT


> Embperl 1.3.4 does not appear to understand CODE refs. For example,
> this code generates the error below:
>
> [-  sub fubar { return "test" }    -]
> [-  $subref = \&funar;             -]
> [+  $subref->();                  +]
>
> [23204]ERR: 24: Error in Perl code: Undefined subroutine
>   &HTML::Embperl::DOC::_1::test called at ....
>
>
> Is this expected?  Is there a way to change this behavior?
>

Of course Embperl can call CODE refs, the problem you see here is a escaping
problem. Embperl 1 treats the backshlash as escaping charater per default.
Either write

[-  $subref = \\&fubar;             -]

or set optRawInput in your httpd.conf.

Gerald

P.S. In Embperl 2.0 optRawInput is set by default, so in 2.0 it will work
without these extra settings



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message