codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  hash of hashes  hanlie at 19:05 on Sunday, November 26, 2006
 


$x{VAR_1} = 1;
$x{VAR_1}{VAR_2} = 2;


$x{VAR_1}++;
$x{VAR_1}{VAR_2}++;

print $x{VAR_1}."\n";
print $x{VAR_1}{VAR_2}."\n";


Output is 2,1
Does anyone know why it isn't 2,3?

Cheers


  Re: hash of hashes  mimir at 16:17 on Saturday, February 24, 2007
 

$x{VAR_1} = 1;
$x{VAR_1}{VAR_2} = 2;//here you delete the former line.


$x{VAR_1}++;
$x{VAR_1}{VAR_2}++;

print $x{VAR_1}."\n";
print $x{VAR_1}{VAR_2}."\n";



I think you must either treat it as a one dimensional array or two dimensional array,
not both.


  Re: hash of hashes  mimir at 16:18 on Saturday, February 24, 2007
 

Check out 1.3. on how to get a visual debugger. (http://www.hermanningjaldsson.com/1/pdg/pdg.html)

It really helps in situations like this.

Mimir









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Date script issues
•  perl script help needed
•  onChange issue
•  perl remote execution
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007