programming:mojo
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| programming:mojo [2018/10/24 12:32] – created clemix | programming:mojo [2020/01/26 20:08] (current) – clemix | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| %% Replaced with " | %% Replaced with " | ||
| + | |||
| + | ====== Constructor ====== | ||
| + | <code perl> | ||
| + | sub new { | ||
| + | my $class = shift; | ||
| + | bless @_ ? @_ > 1 ? {@_} : {%{$_[0]}} : {}, ref $class || $class; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <code perl> | ||
| + | sub new { | ||
| + | my ($class, $aaa) = @_; | ||
| + | my $self; | ||
| + | if (ref($class) ne '' | ||
| + | $self = $class; | ||
| + | } else { | ||
| + | $self = bless {class => $class}, $class; | ||
| + | } | ||
| + | |||
| + | $self-> | ||
| + | |||
| + | return $self; | ||
| + | } | ||
| + | </ | ||
programming/mojo.1540377129.txt.gz · Last modified: by clemix
