Next Program Repair Shop 65

Capturing the same pattern repeatedly

     my ( $user, $system, $nice, $idle ) = 
       `top -b -n 0` =~      
       /^CPU states:\s+([0-9.]+)% user,\s+([0-9.]+)% system,\s+([0-9.]+)% nice,\s+([0
     -9.]+)% idle/m;

        ($user, $system, $nice, $idle) = ($line =~ m/[0-9.]+/g);



Next Copyright © 2006 M. J. Dominus