Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: creating a subroutine for accessing hash of arrays

by tilly (Archbishop)
on Mar 27, 2004 at 06:53 UTC ( #340225=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if (exists $partners{$item}) {
      my ($partners, $email, $nickname, $realname, $postcode, $phone) = @{
    +$partners{$item}};
      # Do something.
    }
    
  2. or download this
    if (exists $partners{$item}) {
      push @allmembers, $item,
        split / /, $partners{$item}{partners};
    }
    
  3. or download this
    sub do_for_partners {
      my ($item, $action) = @_;
    ...
      push @allmembers, shift;
      push @allmembers, (shift)->{partners};
    });
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-02-06 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (33 votes). Check out past polls.

    Notices?