in reply to help me interpret Dumper output.
$VAR1 = { #Variable is a hashRef 'table' => [ #One key is "table", # which gives an arrayref. [ #The first element in that array #is another arrayref 'CredSMB.168', #Element 0 # AKA $VAR1->{table}[0][0]; '168', '1', 'Customer.1', #Element 3 '', 'BNS-NA-CA-SMB-SCGLOBAL', '3', 'SCGLOBAL', 'ip360scglobal' ] ], 'columns' => [ #Another key is "columns", #which gives an arrayref. 'REFERENCE', # array element [0] 'id', 'type', 'customer', 'notes', 'name', 'authAlgorithm', 'domain', 'userName' ] };
You might want to consider a simpler rearrangement:
Have a hash where the keys are what is currently in 'columns' and the values are what is currently in 'table'.
$rowHash->{id} = 168; for example.
Depending on how you want to use them, you could make an array of such hashes, or a hash of those hashes (with the keys being some unique combination of data, such as the ID).
By having just a hash of hashes, you can manipulate the "table rows" much easier.
$rowHash = {id=>168, name=>'Jack'}; # create row $tableHash->{$rowHash->{id}} = $rowHash; # add row to table delete $tableHash->{$rowHash->{id}}; # delete row from table $tableHash->{168}{name} = 'Jill'; #update single value
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help me interpret Dumper output.
by rbaldwin (Novice) on Oct 08, 2009 at 16:04 UTC |