Matt wrote:

> I have a perl script but I want to exit it if the uptime on the 
server
> is less then say an hour.  Any idea how I would get uptime with 
perl?


Hi,

You could use the distribution: Unix::Uptime 
(http://search.cpan.org/perldoc?Unix::Uptime)

Example:

use strict;
use warnings;

use Unix::Uptime;

my $uptime_hours = Unix::Uptime->uptime() / 3600;
if ( $uptime_hours < 1 ) {
    exit(127);
}

Regards,
Alan Haggai Alavi.
-- 
The difference makes the difference.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to