LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-22-2004, 09:51 PM   #1
weird_guy
LQ Newbie
 
Registered: May 2003
Location: Brazil
Distribution: Red Hat 9 + Fedora
Posts: 22

Rep: Reputation: 15
weird behaviour with hashes in perl


Now , this is something odd... I'm doing a script to check some websites and it creates two arrays with 3 indexes and each (i,j,k) position in the array contains a hash.
In one of the arrays , I can simply do %temphash = %{$array1[$i][$j][$k]};
and it works... On the other , I can do whatever comes to my mind and I simply cant acess the data on the hash...
Here is some weird stuff shown by perl -d :
Code:
main::CheckMirror(script.pl:146):                       {
  DB<3> p $mirror[$i][$j][$k]
HASH(0x10501d28)
  DB<4> p %{$mirror[$i][$j][$k]}

  DB<4> p %{$mirror[$i][$j][$k]}

  DB<5> p $i 
0
  DB<6> p $j
0
  DB<7> p $k
0
  DB<8> p $mirror[0][0][0]
HASH(0x10501d28)
  DB<9> p %{$mirror[0][0][0]}

  DB<10> p $otherhash[0][0][0]
HASH(0x103443a0)
  DB<12> p %{$otherhash[0][0][0]}
Then it shows the whole hash stored at $otherhash[0][0][0].

Any ideas? I've tried:
%aux = %{$mirror[$i][$j][$k]}
$mirror[$i][$j][$k]->{"$key"}

and none of them worked... any ideas???
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
9.3 weird behaviour ????? bigjohn SUSE / openSUSE 9 07-06-2005 05:44 AM
Passing hash of hashes as a parameter (Perl) rose_bud4201 Programming 8 04-21-2005 07:18 PM
weird slit behaviour RaulConQ Linux - Software 7 10-31-2004 09:14 AM
Weird DNS (?) behaviour jalonsom Linux - Networking 1 10-31-2004 06:55 AM
Weird Apache behaviour ? zalmox Linux - Software 1 11-10-2003 08:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration