adriang has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Why the second while function don't work
my %weekday=( 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday", 7 => "Sunday", ); while ( (my @all )=each(%weekday) ) { say "@all"; } while ( each(%weekday) ) { say; }
Thanks in advance, Adrian
Update: I figure out how the each function is working: "Every time the each function is called, it grabs an element out of the hash and puts them ..." Shame me for the question Adrian
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: each function
by tobyink (Canon) on Jun 03, 2014 at 17:27 UTC | |
by adriang (Sexton) on Jun 04, 2014 at 17:28 UTC | |
|
Re: each function
by choroba (Cardinal) on Jun 03, 2014 at 13:42 UTC | |
by RonW (Parson) on Jun 03, 2014 at 23:08 UTC | |
|
Re: each function
by AnomalousMonk (Archbishop) on Jun 03, 2014 at 19:39 UTC | |
by adriang (Sexton) on Jun 04, 2014 at 17:26 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |