in reply to printing array values
print $fvalues{$_}, "\n" for keys %fvalues;
Update: incidentally, while there may be some corner cases in which C-style for loops would result to be convenient, most often perl-style ones cover the vast majority of cases and are most advantageous.
Update2: oh, and now that I think of it, while the above is more similar to what you were doing in that it iterates over the keys,
is conceptually simpler. But then it may be more convenient to (locally) set ($\,$,) suitably and directly writeprint $_, "\n" for values %fvalues;
Of course if you want to have output sorted according to the keys (as per holli's suggestion at Re^2: printing array values) or something similar, then you have to use keys.print values %fvalues;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: printing array values
by holli (Abbot) on May 19, 2005 at 09:44 UTC | |
Re^2: printing array values
by texuser74 (Monk) on May 19, 2005 at 08:54 UTC | |
by blazar (Canon) on May 19, 2005 at 09:11 UTC |