- or download this
my $self = {};
...
bless $self, $class;
return $self;
}
- or download this
sub public_method {
my ($self,$args) = @_;
...
sub _do_private_stuff {
print $self->{foo};
}
- or download this
sub public_method {
my ($self,$args) = @_;
...
my $self = shift;
print $self->{foo};
}
- or download this
//avert your eyes - Java code ahead
class Ball {
...
this.color = c;
}
}