"JupiterHost.Net" <[EMAIL PROTECTED]> skrev i en meddelelse
news:[EMAIL PROTECTED]
> Ditlev, Unix Consulting wrote:
>> Hi There,
>
> Hello,
>
>> I have some problems undestanding how to parse a hash to module of my
>> own.
>>
>> I have this hash %person :
>> $person{$Name}{Name} = "xxx";
>> $person{$Name}{Id} = zzzz;
>> @( $person{$Name} {Friends} )
>>
>> But what's the correct method for parsing this hash to my module ???
>>
>> I try something like mymodule::method(%person)
>>
>> or should I parse it as a reference ?
>> mymodule::method(\$person)
>
> I think "parse" is the wrong word :) i think you mean "pass"?
Yes its pass I mean.
>
> You can do either but a refernce is more efficient:
Maybe I should use a reference as you suggest now Iam using ...
MyModule::function(%person)
and in my function :
my %person = @_;
For now I don't think I have an performance issue, - but ofcourse for now I
have 2 copies. Any drawbacks if I try some kind of asyncrhonous call if
possbile ??.
Thnks for the input.
>
> MyModule::function(\%person);
>
> MyModule->method(\%person);
>
>
> sub ... {
>
> my ($person_ref) = @_;
>
> ...
>
> }
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>