Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Help in manipulating values from two arrays

by Anno (Deacon)
on Mar 24, 2007 at 09:02 UTC ( [id://606398]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use List::Util qw( sum);
    
    ...
        $_ = @$_ ? sum( @$_)/@$_ : '';
    }
    print "$_ - $prod{ $_}\n" for @emp_lst;
    
  2. or download this
    while ( <DATA> ) {
        my ( $emp) = m{<emp>(\d+)</emp>} or
    ...
        push @emp_lst, $emp unless $prod{ $emp};
        push @{ $prod{ $emp} }, m{<prod>([.\d]+)</prod>};
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found