Jeff 'Japhy' Pinyan wrote:
> On Oct 9, stanley said:
>
>
>>sub givename(%a)
>
>
> DO NOT try to put variables in the declaration of a function. Unless you
> are into HEAVY MAGIC, your subroutine declarations (or definitions) should
> look like
>
> sub function_name {
> # ...
> }
>
> No () there. When you CALL the function, THEN you use ().
>
> foobar(%x);
>
> sub foobar {
> my %copy_of_x = @_;
> # ...
> }
>
and do not pass hash arrays directly as parameters You will mess up If
you have more than 1 of them
use foobar(\%x);
sub foobar {
my($ref_to_hash_x)=@_;
my(%copy_of_x) = %{$ref_to_hash_x};
# ...
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]