convenientstore has asked for the wisdom of the Perl Monks concerning the following question:
sub sub1 { my %enc; for (@_) { chomp; if ( $_[0] =~ /^ "xxxx-(\d+):xxxxxx([^,]+),.+"$/ ) { $enc{$1} = $2; } else { next; } } } %hash1 = sub1(@dc);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing @ to sub and getting back hash
by Joost (Canon) on Dec 31, 2007 at 21:04 UTC | |
|
Re: passing @ to sub and getting back hash
by ysth (Canon) on Dec 31, 2007 at 21:05 UTC | |
by convenientstore (Pilgrim) on Dec 31, 2007 at 21:17 UTC | |
|
Re: passing @ to sub and getting back hash
by runrig (Abbot) on Dec 31, 2007 at 21:05 UTC | |
|
Re: passing @ to sub and getting back hash
by jwkrahn (Abbot) on Dec 31, 2007 at 21:22 UTC | |
by GrandFather (Saint) on Dec 31, 2007 at 21:56 UTC | |
by jwkrahn (Abbot) on Jan 01, 2008 at 03:30 UTC | |
by NetWallah (Canon) on Jan 01, 2008 at 04:12 UTC | |
by GrandFather (Saint) on Jan 01, 2008 at 05:03 UTC | |
by convenientstore (Pilgrim) on Jan 01, 2008 at 02:00 UTC |