1 package Mark; 2 3 4 use strict; 5 6 sub new { 7 my $self = { 8 hello => [[],[]] 9 }; 10 bless $self; 11 return $self; 12 } 13 14 sub setup { 15 my $self = shift; 16 $self->{hello}[0] = [ "hello", "there", "son" ]; 17 return $self; 18 } 19 20 sub printer { 21 my $self = shift; 22 23 print "Array count: " . scalar(@$self->{hello});; 24 25 #for(my $i = 0; $i < scalar $self->{hello}[0]; $i++) { 26 # print $self->{hello}[0][$i] . " "; 27 #} 28 print "\n"; 29 } 30 31 1; 1 #!/usr/bin/perl 2 3 4 use strict; 5 require Mark; 6 7 my $instance = Mark::new(); 8 9 $instance->setup(); 10 $instance->printer(); 11 12 13 exit 0;