Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
{ my %MSISDN=(); #populate the subscription list to hash MSISDN open(FILE,"/tmp/subscription_list") || die "Unable to open sub +scription file"; sub file_merge(\%MSISDN); close(FILE); my %Calls=(); #populate the usage types to hash Calls open(FILE1,"/tmp/Call_Det")|| die "Unable to open call_details +file"; sub file_merge(\%Calls); close(FILE1); } sub file_merge(%hash_ref) { while (<>) { chomp; my ($key, @values) = split /-/, $_; push @{$hash_ref{$key}}, [ @values ]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash as subroutine argument
by davorg (Chancellor) on Jul 02, 2009 at 13:16 UTC | |
by Anonymous Monk on Jul 03, 2009 at 04:29 UTC | |
by davorg (Chancellor) on Jul 03, 2009 at 05:48 UTC | |
|
Re: hash as subroutine argument
by ww (Archbishop) on Jul 02, 2009 at 13:18 UTC | |
by Anonymous Monk on Jul 03, 2009 at 04:36 UTC | |
by ww (Archbishop) on Jul 03, 2009 at 10:29 UTC | |
|
Re: hash as subroutine argument
by BioLion (Curate) on Jul 02, 2009 at 13:11 UTC | |
by davorg (Chancellor) on Jul 02, 2009 at 13:17 UTC | |
by BioLion (Curate) on Jul 02, 2009 at 14:02 UTC | |
|
Re: hash as subroutine argument
by Anonymous Monk on Jul 02, 2009 at 13:15 UTC |