0 replies on 1 page.
package Stuff; sub new { my ( $class, @args ) = @_; bless { args => \@args, } => $class; } sub add_args { my $self = shift; push @{ $self->{args} } => @_; # UGLY!!! }
class Stuff def initialize(*args) @args = args end def add_args(*args) @args.push(*args) end end
Read: Ruby FTW!