package Class2; use strict; sub new { my $class = shift; my $self = {}; bless($self, $class); return $self; } sub data { @_ == 3 or die 'usage: Class2->data( DATE, SUBJ )'; my $me = shift; $me->{date} = shift; $me->{subj} = shift; print "The Date is: $me->{date}\n"; print "The Subject is: $me->{subj}\n"; } sub printClass { my $self = shift; my $class = ref($self); print "Your class type is $class\n"; print "The Date is: $self->{date}\n"; print "The Subject is: $self->{subj}\n"; } sub getDate { (shift)->{date}; }
In reply to Re (tilly) 1: Array of Objects
by tilly
in thread Array of Objects
by mikeyYankoski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |