Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Help in manipulating values from two arrays

by Anno (Deacon)
on Mar 24, 2007 at 09:02 UTC ( #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? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2022-11-30 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?