Re: reference to hash

2002-05-14 Thread Felix Geerinckx
on Tue, 14 May 2002 16:43:42 GMT, [EMAIL PROTECTED] (Joe Mecklin) wrote: > ($connect_id = ars_Login($server, $userid, $password)) || die > "Can't login:$ars_errstr\n"; If you use 'or' instead of '||' you won't need the silly looking outer '()'. > (%properties = ars_GetField($con

RE: reference to hash

2002-05-14 Thread Ross Howard
tml Hope this helps. (BTW: Also, your question probably belongs on the ARSperl mailing list.) Ross -Original Message- From: MECKLIN, JOE (ASI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 12:44 PM To: '[EMAIL PROTECTED]' Subject: reference to hash All, I've been f

reference to hash

2002-05-14 Thread MECKLIN, JOE (ASI)
All, I've been fighting this for a while and I'm afraid I can't see the trees for the forest now (yes, I know that's bass-ackwards)... I'm using ARS.pm to access the Remedy product. One function - ars_GetField() - returns a reference to a hash, and what I've been trying to read isn't sinking in

Re: can't use reference to hash in subroutine?

2001-11-08 Thread Brett W. McCoy
On Thu, 8 Nov 2001, Lisa Neclos wrote: > I am getting the following error when trying to run this. I'm trying to > pass a hash as a reference to the subroutine. > > ERROR - Type of Arg 1 to each must be hash (not private variable) > > my $ref_hash ; > %hash = ("sky", "blue", "grass", "green", "a

Re: can't use reference to hash in subroutine?

2001-11-08 Thread Jeff 'japhy' Pinyan
On Nov 8, Lisa Neclos said: >sub print { I wouldn't name a function print() if I were you. >while (my($key, $val) = each($ref_hash)) { #while hash has another Since $ref_hash is a reference to a hash, and each() needs a hash, use %$ref_hash, or %{ $ref_hash }. -- Jeff "japhy" Pinyan [E

can't use reference to hash in subroutine?

2001-11-08 Thread Lisa Neclos
I am getting the following error when trying to run this. I'm trying to pass a hash as a reference to the subroutine. ERROR - Type of Arg 1 to each must be hash (not private variable) my $ref_hash ; %hash = ("sky", "blue", "grass", "green", "apple", "red") ; $ref_hash = \%hash ; sub print { wh