Re: execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Ok, now I added the: my $regex = "^((?!total).)*\$"; I also removed the " " from the numbers in the if test: if ($array[6] >= 867580){ The error msg I get this time, is like this: r...@user# ./script.pl 0 Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl lin

Re: execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Tnx Guys! the $vgs variable is of course and error and should be $memory. After adding your suggestions, I ran the script over again and got this error: r...@user# ./script.pl Final $ should be \$ or $name at ./script.pl line 11, within string syntax error at ./script.pl line 11, near "= "^((?!to

execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Hi, I want my code to execute the unix free command in order to analyze the memory state, and issue a warning if the cached memory increases. I don`t know what I did wrong, but this is what I got for now: #! /usr/bin/perl use warnings; use strict; # return codes $ok = 0; $warning = 1; $critical