#!/usr/bin/perl use strict; use warnings; my @CAL = ( # calibration list for each sensor { 'scale' => 1, 'offset' => 0 }, { 'scale' => 1, 'offset' => 0 }, { 'scale' => 1, 'offset' => 0 }, # ... add more for each TEMPer ); use Device::USB::PCSensor::HidTEMPer; my $pcsensor = Device::USB::PCSensor::HidTEMPer->new(); my $count = 0; foreach ( $pcsensor->list_devices() ) { $_->internal()->celsius(); my $temp = $_->internal()->celsius(); if ( exists $CAL[$count]{'scale'} and exists $CAL[$count]{'offset'} ) { $temp *= $CAL[$count]{'scale'}; $temp += $CAL[$count]{'offset'}; } ++$count; print "$temp\n"; }