Sys::Apm - Perl extension for APM
use Sys::Apm; my $apm = Sys::Apm->new or die "no apm nupport in kernel"; print $apm->charge
This module allows you to query your battery status and such through /proc/apm
Fetches the data from /proc/apm This method is called once in the constructor
Linux APM driver version
APM BIOS Version. Usually 1.0, 1.1 or 1.2.
AC line status 0x00: offline 0x01: online 0x02: on backup power 0xff: unknown
Battery status 0x00: High 0x01: Low 0x02: Critical 0x03: Charging 0x04: No battery
Remaining battery life (percentage of charge) 0-100: valid -1: Unknown
Remaining battery life (time units): Number of remaining minutes or seconds -1: Unknown
min: minutes sec: seconds
apm(1) arch/i386/kernel/apm.c
Raoul Zwart, <rlzwart@cpan.org>
Copyright 2003 by Raoul Zwart
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Sys::Apm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Apm
CPAN shell
perl -MCPAN -e shell install Sys::Apm
For more information on module installation, please visit the detailed CPAN module installation guide.