how can i pass a hash variable to a subrotine?
such as
%a=(m=>1,n=>2);
%b=(k=>4,j=>6);
sub givename(%a)
{
#here how can make %c get the subroutine argument(a hash variable))
my %c=???;
print %c;
}
-
Do you Yahoo!?
Faith Hill - Exclusive Performances, Vi
On Wed, 9 Oct 2002, stanley wrote:
>
> how can i pass a hash variable to a subrotine?
>
> such as
>
> %a=(m=>1,n=>2);
>
> %b=(k=>4,j=>6);
>
> sub givename(%a)
>
> {
>
> #here how can make %c get the subroutine argument(a hash variable))
>
> my %c=???;
>
> print %c;
>
> }
Read through
p
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 ()
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 {
> # ...
> }
>
>