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

Re: Retunining hash values from subroutines

by BillKSmith (Monsignor)
on Jun 20, 2013 at 10:52 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-24 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found