in reply to Passing a list to an Object
First of all, there were a couple syntax errors in your posted code, please paste in the real code whenever possible to avoid typos.
When making an object or class method call like:
$obj->method(arg); #or Class->method(arg); # your example
The method actually receives the $obj or 'Class name' as its first argument (depending on which call you made). So in your example, in your doThat() method you are assigning the following: %ARGS = ('chew', 'meat', 'MyObject', 'chew', 'bananas').
So, 'MyObjects' is taken as a key with a value of 'chew' and 'bananas' is left just sitting there doing nothing. If you had -w turned on you would have been warned about assigning an odd number of elements to a hash.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing a list to an Object
by lzcd (Pilgrim) on Jan 13, 2001 at 07:22 UTC | |
by danger (Priest) on Jan 13, 2001 at 07:30 UTC | |
by lzcd (Pilgrim) on Jan 13, 2001 at 07:33 UTC |