> One reads "fubar", the other "funar", is that what you intended?
No, sorry, that was a mail typo.
Btw- note that the Embperl complaint is that a sub
called 'test' is undefined. 'test' happens to be the return
string from the sub itself. It seems as if Embperl has executed
the coderef and used its return value as the name of the
[- sub fubar { return "test" } -]
[- $subref = \&fubar; -]
[+ $subref->(); +]
[23204]ERR: 24: Error in Perl code: Undefined subroutine
&HTML::Embperl::DOC::_1::test called at ....
Btw- I just tried an alternate calling syntax, and it works:
[+ &{$coderef} +]
However, that doesn't help me a lot since I'm trying to (re)use
some modules that take CODE refs as arguments for callback and
the modules execute those in the $coderef->() style.
Mark
-----Original Message-----
From: Daniel Barbar [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 1:40 PM
To: 'Mark Dedlow'
Cc: [EMAIL PROTECTED]
Subject: RE: emperl can't invoke CODE refs?
Mark,
One reads "fubar", the other "funar", is that what you intended?
---
Daniel Barbar
-----Original Message-----
From: Mark Dedlow [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 1:35 PM
To: [EMAIL PROTECTED]
Subject: emperl can't invoke CODE refs?
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?
Thanks,
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]