[Nut-upsuser] some help in using the package NUT in a perl script

Charles Lepple clepple at gmail.com
Wed Feb 27 12:57:13 UTC 2013


On Feb 27, 2013, at 6:27 AM, Llabres Thill wrote:

> print " UPS charge batterie :  $ups->BattPercent() \n";
[...]
> Bu i got : something like : "UPS::Nut=HASH(0x8505ad0)->BattPercent()" instead of the value expected...<smiley-frown.gif>

It's been a while since I used perl, but it sounds like you might need an extra set of parentheses, or a local variable:

my $batt_percent = $ups->BattPercent();
print " UPS charge batterie :  $batt_percent \n";

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsuser mailing list