o2bwise has asked for the wisdom of the Perl Monks concerning the following question:
my $count = 0; while (my($key, $value) = each(%ip_discover_count) and $count == 0) { $count++; } if ($count > 0) { my $seedFileName = "$CC\_discover.txt"; open (SEED,">$dir/$seedFileName"); while ((my $key, my $value) = each(%ip_discover_count)) { $ip = &trim($key); my $snmp_read = &trim($ip_discover_snmp{$key}); print SEED "$ip\t\$snmp_read\n"; } close (SEED); }
my $count = 0; my $seedFileName = "$CC\_discover.txt"; open (SEED,">$dir/$seedFileName"); while (my($key, $value) = each(%ip_discover_count) and $count == 0) { print SEED "Key: $key\tValue: $value\n"; $count++; } if ($count > 0) { my $seedFileName = "$CC\_discover.txt"; #open (SEED,">$dir/$seedFileName"); print SEED "Count:\t$count\n"; while ((my $key1, my $value1) = each(%ip_discover_count)) { $ip = &trim($key1); my $snmp_read = &trim($ip_discover_snmp{$key1}); print SEED "xx$ip\xx\n"; } close (SEED); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why Does the Hash Seem Empty?
by dave_the_m (Monsignor) on Jul 20, 2007 at 19:22 UTC | |
|
Re: Why Does the Hash Seem Empty?
by jwkrahn (Abbot) on Jul 20, 2007 at 19:31 UTC | |
by o2bwise (Scribe) on Jul 20, 2007 at 19:44 UTC | |
by imp (Priest) on Jul 20, 2007 at 19:54 UTC | |
by yaneurabeya (Novice) on Jul 20, 2007 at 19:56 UTC | |
|
Re: Why Does the Hash Seem Empty?
by FunkyMonk (Bishop) on Jul 20, 2007 at 19:28 UTC |