pass a hash to a subroutine

2002-10-09 Thread stanley
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

Re: pass a hash to a subroutine

2002-10-09 Thread Sudarshan Raghavan
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

Re: pass a hash to a subroutine

2002-10-09 Thread Jeff 'japhy' Pinyan
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 ()

Re: pass a hash to a subroutine

2002-10-10 Thread Ramprasad A Padmanabhan
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 { > # ... > } > >