Hi -

I don't really understand what you are trying to do,
but if you want to print the key/value pairs of a hash
the common way to do that is:

for (%ENV) {
  print "$_ $ENV{$_}\n";
  }

or even more concise:

print "$_ $ENV{$_}\n" for (%ENV);

Aloha => Beau.

-----Original Message-----
From: SATAR VAFAPOOR [mailto:sattarv@;yahoo.com]
Sent: Sunday, November 10, 2002 4:54 PM
To: [EMAIL PROTECTED]
Subject: hash



Hi all,

When I run the following code(with any hash), I get a contiuous stream of
output. The presence of the array in the loop causes the contiuous stream of
output. When the array is commented out an output is generated. Why does the
presence of the array cause a contiuous stream of output. Thanks

while (($k,$v)= each %ENV)
{
  @ks=keys %ENV;
  print "$k     $v\n";
}





---------------------------------
Do you Yahoo!?
U2 on LAUNCH - Exclusive medley & videos from Greatest Hits CD



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to