- or download this
sub set_attr {
# 0 self
...
# 1 attr
$_[0]->{$_[1]}
}
- or download this
sub set_attr {
my $self = shift;
...
my $value = shift;
$self->{$attr} = $value;
}
- or download this
sub addNums {
# 0 self
...
# 2 value
$_[0]->{$_[1]} = $_[2];
}
- or download this
sub capitalize {
my ($word) = @_;
$word = "\u$word";
return $word;
}
- or download this
sub capitalize {
$_[0]="\u$_[0]";
}
- or download this
$word = captitalize($word);
- or download this
captitalize($word);