in reply to Problem in accessing array of objects.

Besides what almut says (emphasis on "use strict;"), your code has a couple of problems. The main one is that you need use square brackets to initialize an array reference. You can't have arrays inside a hash (or hash ref), only references to arrays. So, in function module::_define, you should have:
my $object = { name => $name , port_list => [] , verilog_list => [] , signal_list => [] , instance_list => [] };
Also, the "Main program" part of your program is not actually in package 'main' as it should be. It's actually running as part of the initialization of the last package declared, in this case 'module'. That can cause problems. Unless it's declared inside a { } block, a package declaration is in effect in your source code until the next package declaration. You could define package signal like this:
{ package Signal; sub _define{ my $type = shift ; my $name = shift ; my $width = shift ; if(($type ne "reg") && ($type ne "wire")) { printf("\n***** ERROR: Wrong Signal type %s\n",$type); exit(1); } my $object = { type => $type , name => $name , width => $width }; bless($object,__PACKAGE__); return $object; } sub print_defn { my $self = shift; printf("\t%s",$self->{type}); if(($self->{width})!=1) { printf("\t[%d:0]",($self->{width})-1) } else { print(" "); } printf("\t\t\t%s;\n",$self->{name}); } }
Note the use of the enclosing curly braces. Also, I used __PACKAGE__ in the bless call. I could have also just written bless $object;. If you plan to ever use class inheritance in your program, though, it's better to use the more conventional Perl style which explicitly passes the class as the first argument. You would call Signal->_define($type,$name,$width); instead of Signal::_define($type,$name,$width); and then _define would have another parameter:
sub _define{ my $class = shift ; my $type = shift ; my $name = shift ; my $width = shift ; if(($type ne "reg") && ($type ne "wire")) { printf("\n***** ERROR: Wrong Signal type %s\n",$type); exit(1); } my $object = { type => $type , name => $name , width => $width }; bless($object, $class); return $object; }