in reply to two problems about passing var between classes

I think noone commented so far on your second problem. So let me do that and look at your code first:

%ha = $obj -> passhash; foreach $key (keys (%ha)){ if ($key eq "problem2"){ foreach (@ha{$key}){ print "array : @{$_}\n"; } } }
The loop over all keys doesn't make much sense for a hash, after all, you use a hash to get easy access to its elements via the key (here: 'problem2'). So instead you would write: $ha{'problem2'}.

The entry of the hash %ha corresponding to the key 'problem2' is a reference to an array of arrays. To get to the values of that you have to dereference it: @{$ha{'problem2'}} or equivalent @$ha{'problem2'}.

Now you have an array which elements are references to arrays. You could print the elements of these (referenced) subarrays like this:

foreach my $arr_ref (@$ha{'problem2'}) { print "subarray: @{$arr_ref} \n"; }

Note: Your code works, if you replace the hash slice notation (@ha{$key}) with the dereferencing of the hash entry @$ha{$key}. The hash slice notation is normally used to get multiple values out of hash in one go, you (probably accidently) used it to extract just one value. This is then equivalent to $ha{$key}. An example of a good usage of a hash slice would be

my %hash; @hash{qw/one two three/} = qw/1 2 3/;

-- Hofmator