On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
snip
Is it actually incorrect to run: stop_it(@DNS); aside from maybe looking 
strange?
snip

It doesn't look strange, but your code only works with the first
element of @DNS so it is pointless.  If you want to say stop_it(@DNS)
and actually do something with the the other values in @DNS you will
need a loop inside the sub:

sub stop_it {
   for my $vm (@_) {
       my $state = `/usr/bin/vmware-cmd "$vm" getstate -q`;
       .
       .
       .
   }
}

If you really only want to work with the first value in @DNS then you should say

stop_it($DNS[0]);

to avoid confusing people.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to