$self = {@_}, but not $self->{_args}->{@_}

Why doesn't this work both ways

$o = Obj->new(param1 => "nuts", param2 => "bolts")


Works great.
sub new
  $class = shift;
  $self = {@_};

foreach $k (keys %$self) {


Fails to load anything I can see
sub new
  $class = shift;
  $self = {};
  $self->{_args}->{@_};

foreach $k (keys %{$self->{_args}}) {
LVL 1
hank1Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ozoConnect With a Mentor Commented:
$self->{_args} = {@_};
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.