Help for this page

Select Code to Download


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