in reply to Sub calling sadness
The syntax:
is the method-object calling syntax. For instance, consider:ThatPackage::blah $foo
This will call ThatPackage::blah with first argument of $baz usingmy $baz = []; bless $baz, "ThatPackage"; ok( blah $baz, 'blah-baz');
By contrast, the syntax: ThatPackage::blah($bar) is simple function calling syntax. In this case the subroutine ThatPackage::blah must be defined or an error will be raised.
When using method-object syntax I would say that verifying that the object at least looks like an object is a useful check to make sure that you're doing what you think you're doing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sub calling sadness
by ikegami (Patriarch) on Mar 08, 2008 at 07:12 UTC | |
by pc88mxer (Vicar) on Mar 08, 2008 at 07:27 UTC | |
by ikegami (Patriarch) on Mar 08, 2008 at 17:35 UTC | |
|
Re^2: Sub calling sadness
by nefigah (Monk) on Mar 08, 2008 at 07:18 UTC |