Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Please help me find my error.

by muba (Priest)
on Jun 21, 2012 at 23:25 UTC ( #977730=note: print w/ replies, xml ) Need Help??


in reply to [ RESOLVED ] Please help me find my error.

foreach $item ($costs)
You probably mean foreach $item (keys %costs). Note the use of the keys keywords so that you only loop over the keys of %costs, so that you can then do $cost += $costs{$item};

You wrote $costs, you probably meant %costs.


my %costs = $v{hourly_worker_expenses};
This also probably isn't what you meant, because earlier you assigned a hashref to that slot. And hashrefs need to be dereferenced. The line should probably read my %costs = %{$v{hourly_worker_expenses}};

HTH.


Comment on Re: Please help me find my error.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977730]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2015-07-02 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (46 votes), past polls