# simplified version my @array = ({id=>1, name=>'Linux'}, {id=>2, name=>'Perl'}); my $self = [@array]; bless $self, $class