- or download this
method foo ($x) {
return $x + 1;
}
- or download this
sub foo {
my $self = shift;
my $x = @_>=1 ? shift(@_) : croak("Requires \$x");
return $x + 1;
}
- or download this
method bar ($x) { }
- or download this
sub bar {
my $self = shift;
my $x = @_>=1 ? shift(@_) : croak("Requires \$x");
}