On Mon, Oct 09, 2000 at 05:03:44PM -0700, Joshua Chamas wrote:
> When I execute $Request->Form->('test')->Item()
> on a real life code sample, even after building in 
> support for $Request->Form('test')->Item(), I get
> this error:
> 
>   Not a CODE reference at (eval 14) line 10.
> 
> I have seen this error before with this syntax...
> is this really supposed to work?  I thought it
> was not supposed to be supported by perl.  I saw
> that it passed compilation, but perl saves some things
> for runtime checking.  It works in VBScript because
> that language has the notion of a default method for
> an object class to cover these instances.

Those syntaxes are saying two separate things.

$Request->Form('test')->Item() calls the method `Form' on the object
`$Request' with argument `test', and calls the method `Item' with no
arguments on the result.

$Request->Form->('test')->Item() calls the method `Form' on the object
`$Request' with no arguments, and calls the return value as a subroutine
with argument `test'. Thus, if `Form' doesn't return a coderef, it will
crash and burn.

-dlc

Reply via email to