- or download this
use Carp;
sub name {
...
}
return $self->{name};
}
- or download this
sub set_name {
my $self = shift;
...
if (@_) { warn "Attempt to set value in get" }
return $self->{name};
}
- or download this
my $val = $obj->set_name(@foo);
- or download this
die "No arguments in set_name()" unless @_;