Solved

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

Posted on 2006-11-22
1
250 Views
Last Modified: 2010-03-05
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}}) {
0
Comment
Question by:hank1
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
ID: 17999193
$self->{_args} = {@_};
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

709 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now