MyClass->doThat(chew=>'bananas')
The arguments don't get passed as a hash. '=>' doesn't automatically transform things into hashes, but instead is the equivalent of a comma, with the side effect of ensuring that the word before it is interpreted as a string. So it's the equivalent of saying:
MyClass->doThat('chew', 'bananas')
Or even:
MyClass::doThat('MyClass', 'chew', 'bananas')
So it's a list, not a hash, and you don't need to worry about order getting scrambled. The list doesn't turn into a hash until you do something like:
sub doThat {
my $type = shift;
my %input = @_;
}
Then, you've copied the list into an associative array. Until then, plain-vanilla list... Sorry to flog a dead horse, but I saw a misconception waiting to happen...
stephen
|