Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by hdp (1658) on 2008.07.13 9:51 (#63882) Journal
    package Stuff;
    use Moose::Autobox (); # don't actually autobox

    sub new {
      my ($class, @args) = @_;
      bless {
        args =>
          # this is the class that autoboxing would use anyway
          bless \@args => 'Moose::Autobox::ARRAY',
      } => $class;
    }

    sub add_args {
      my $self = shift;
      $self->{args}->push(@_); # NOT UGLY!!!
    }

    # Likewise, use Moose::Autobox::HASH for hashes.