can be done shorter, more efficient, but gives the idea to you.#untested, no perl on the current machine... my @array= qw ( command1 command2 command3); my %hash = (); foreach (@array) { $output = eval($_); $hash->{$_}= $output; } sub command1() { # do something return 1; }
In reply to Re: array and hash
by jbrugger
in thread array and hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |