in reply to Re^6: Generic Data Collection
in thread Generic Data Collection
This simple example assumes you don't want to capture the output of the command or check for success
pojwhile ( <DATA> ) { my @wanted = ( split )[ 0, 5, 9 ]; $wanted[1] =~ s/\D//g; $wanted[2] = sprintf "%05s",$wanted[2]; push @parsed, \@wanted; } my @sorted_by_time = sort { $a->[2] cmp $b->[2] } @parsed; # oldest my $LIMIT = 2; my $count = 0; for (@sorted_by_time){ my $PID = $_->[1]; system("lmutil lmremove -h $PRODUCT $flexlmserver 27000 $PID"); last if ++$count >= $LIMIT }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Generic Data Collection
by Deep_Plaid (Acolyte) on Apr 01, 2013 at 11:49 UTC | |
by poj (Abbot) on Apr 01, 2013 at 12:35 UTC | |
Re^8: Generic Data Collection
by Deep_Plaid (Acolyte) on Apr 01, 2013 at 17:53 UTC | |
by poj (Abbot) on Apr 01, 2013 at 18:12 UTC | |
by Deep_Plaid (Acolyte) on Apr 01, 2013 at 18:32 UTC |
In Section
Seekers of Perl Wisdom