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

Re: Retunining hash values from subroutines

by BillKSmith (Chaplain)
on Jun 20, 2013 at 10:52 UTC ( #1039943=note: print w/ replies, xml ) Need Help??


in reply to Retunining hash values from subroutines

You are almost there.

my %UID_PATH; my %ARR1 = uid(); foreach my $TAB (keys %ARR1) { print "User --> $TAB, Value --> $ARR1{$TAB}\n"; } sub uid { my %UID_PATH; my %ARR2; #add open (FH1, "</etc/passwd") || die "Can't Open : $!"; while (<FH1>) { my %UID_PATH; my @UID = split (/:/, $_); if ($UID[2] > 500) { my $USER = "$UID[0]"; %UID_PATH = ("$USER" => "$UID[5]"); #print "$USER --> $UID_PATH{$USER}\n"; ####### return %UID_PATH; $AAR2{$USER} = $UID_PATH; #add } } return %AAR@; }
Bill


Comment on Re: Retunining hash values from subroutines
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-09-18 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (104 votes), past polls