in reply to Problem in accessing array of objects.

I haven't looked through the entire code in detail, but in multiple places you're confusing something like

$href->{port_list} # correct

with

$href{port_list} # incorrect - assumes a hash %href

(where the $href stands for $module, $self, etc.)

As the object is a hash reference, you need the arrow here  (you can omit later arrows as in $href->{foo}{bar}, but not the first).

#!/usr/bin/perl -l use strict; # !!! use warnings; my $module = bless { port_list => [qw(a b c)] }, "Foo"; print "size=", scalar @{$module->{port_list}}; # ok print "size=", scalar @{$module{port_list}}; # not ok!

without use strict would give

$ ./835728.pl Name "main::module" used only once: possible typo at ./835728.pl line +9. size=3 Use of uninitialized value $module{"port_list"} in array dereference a +t ./835728.pl line 9. Use of uninitialized value $module{"port_list"} in concatenation (.) o +r string at ./835728.pl line 9. size=

and with:

$ ./835728.pl Global symbol "%module" requires explicit package name at ./835728.pl +line 9. Execution of ./835728.pl aborted due to compilation errors.

Also (though irrelevant to your problem), it's a generally accepted convention to use CamelCase names for normal packages/modules, because all-lowercase names are "reserved" for pragmata (like strict etc.).