in reply to looking for suggestion!!!

In addition:
    if ($run_cmd =~ /check.pl/)is an unnecessary use of the regular expression engine (which is a really complex beasty).
if ($run_cmd eq 'check.pl')
is much easier.

By the way, when submitting code please at least show how your variables are derived. Many have said that the C-style for loop is unnecessary, but actually we do not know what $total_element is. We can only guess it is the highest index number in @run

Replies are listed 'Best First'.
Re^2: looking for suggestion!!!
by GrandFather (Saint) on Jul 24, 2009 at 09:45 UTC

    Given the usage in the OP's code $total_element is the number of element rather than the largest index - this is why C style for loops are so prone to off by 1 errors. ;-)


    True laziness is hard work