Link to home
Start Free TrialLog in
Avatar of hank1
hank1

asked on

$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}}) {
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial