> -----Original Message----- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 2 March 2004 7:20 PM > To: John > Cc: Perl Beginners > Subject: Re: print a 3D array > > John wrote: > > > Problem with my array > > > > 0Tk::Error: Can't use string ("ARRAY(0x22bdfb0)") as an > ARRAY ref while > > "strict > > > refs" in use at > C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\dir635.tmp\gui.pl line > > 307, < > > DATA> line 164. > > > > > You have shown us the error message here. That is good. > Unfortunately, you do > not show us line 307 and the lines just preceding it. That's > bad. It leaves us > with only specualtion. >
If you want speculation, how about.. You used the array reference as a KEY in a hash, and are trying to deref the value of 'key'. Eg, [EMAIL PROTECTED] = [EMAIL PROTECTED]; for( keys %X ) { print $_->[0]; } Anything which is used as a key becomes a string, and can no longer be used as an actual reference. Remember 'ARRAY(0x22bdfb0)' is the scalar representation of a reference, not an actual reference. You cannot convert the scalar back to a reference. You can try, with something like '$ref = unpack("p",0x22bdfb0)' and I'd love to know if it worked. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>