in reply to Accessing values of a Hash object

$self->{i}={[(110,FB),(100,F)]};

This is almost certainly not doing what you think it's doing.

You take two lists - (110, FB) and (100, F) - and flatten them into a single list - (110, FB, 100, F). You then create an anonymous array that contains this list. You then create an anonymous hash where the (single) key is the stringified reference to your anonymous array. There is no value associated with this key.

Adding "use strict" and "use warnings" to your code will really help you to track down problems like this.

Replies are listed 'Best First'.
Re^2: Accessing values of a Hash object
by dReKurCe (Scribe) on Mar 24, 2007 at 06:19 UTC
    Hi, Thanks for drawing attention to this syntax. Won't the value to the stringified key be in fact the anon array. That is the one flattened list. Its here that i thought I could do something like:
    $self->{i}={[(110,FB),(100,F)]} ... $objinstance=Class::package(); $value=$objinstance->{i}; for (@$value){..do some code with (110,FB) and (100,F)}