in reply to perl puzzle - cartoon couple registry (beginner, semi-golf)

$c=[{Fred=>1, Barney=>2, George=>3, Homer=>4, Peter=>5} "Wilma", "Betty", "Jane", "Marge", "Lois" ]; while(my($h,$w)=each %$c){print"$h is married to $w\n";}
I have noticed that this is an extremely braindead post. D'oh!

Replies are listed 'Best First'.
Re: Re: perl puzzle - cartoon couple registry (beginner, semi-golf)
by gumby (Scribe) on Jun 12, 2002 at 19:51 UTC
    #!/usr/bin/perl -w -l %couples = ( Fred=>"Wilma", Barney=>"Betty", George=>"Jane", Homer=>"Marge", Peter=>"Lois" ); print"$h is married to $w"while(($h,$w)=each%couples)