[ic] Array of Hashes

Rick Bragg lists at gmnet.net
Tue May 18 20:10:46 UTC 2010


I want to be able to store an array of hashes in the session, but it
seems I am having trouble with this.  My problem is how do I store a
hash in the session for later? and how do I access this later on?

i.e. storing:

The array would be something like the following:

@AoH = (
    {  sku => "item_101",  color => "green", },
    {  sku => "item_102",  color => "blue", },
    {  sku => "item_103", color => "red", },
    {  sku => "item_104",  color => "gray", },
$Scratch->{saved_item_hash} = join(' ', @AoH);

Then somewhere else on the page access again later somehow with:
  my @AoH = split(' ',$Scratch->{saved_item_hash});

I know this is wrong, but any ideas or best practice for this?


More information about the interchange-users mailing list