in reply to creating a particular hash

Well, this isn't a golf here, but here's a shot at what you want:
$_ = '1,2,3,4,5:one,two,three,four,five'; @_ = split':',$_; @hash{split',',$_[0]}=split',',$_[1]; print $hash{1};


The 15 year old, freshman programmer,
Stephen Rawls

Replies are listed 'Best First'.
Re: Re: creating a particular hash
by mr.nick (Chaplain) on Jun 01, 2001 at 05:30 UTC
    Golf?! Did you say "golf"? How about unnecessarily obsfuscating it?
    sub o { # 1 2 3 4 5 6 # 12345678901234567890123456789012345678901234567890123456789012345678 + split/[,:]/,pop;$hash{$_[$_]}=$_[$_+$#_/2+1]for 0..$#_/2;%hash; }