Help for this page

Select Code to Download


  1. or download this
    sub new {
       my $class = shift;
       my %self = %{$_[0]} if ref $_[0];
       ...
    }
    
  2. or download this
    # Class->new();
    # Class->new({ k=>v, ... });
    ...
       my $class = shift;
       my %self = ref $_[0] ? %{$_[0]} : ();
       ...
    
  3. or download this
    # Class->new();
    # Class->new({ k=>v, ... });
    ...
       my %self = ref $_[0] ? %{$_[0]} : @_;
       ...
    }
    
  4. or download this
    # Class->new();
    # Class->new( k=>v, ... );
    ...
       my ($class, %self) = @_;
       ...
    }