luxs has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use warnings; use YAML::Syck; my $hash = { 'k1'=>'v1', 'k2'=>'v2', 'k3'=>'v3', }; # Part 1 - works fine while ( my ($k, $v) = each(%$hash) ) { print "$k, $v\n"; } # Part 2 - unlimited cycle. Why???? while ( my ($k, $v) = each(%$hash) ) { print "$k, $v\n"; DumpFile("test.yml", $hash); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Action on each key/value pair in a hash
by beech (Parson) on Nov 01, 2016 at 02:49 UTC | |
|
Re: Action on each key/value pair in a hash
by LanX (Saint) on Nov 01, 2016 at 08:12 UTC | |
|
Re: Action on each key/value pair in a hash
by Marshall (Canon) on Nov 01, 2016 at 05:27 UTC |