jamgill has asked for the wisdom of the Perl Monks concerning the following question:
Why do I get the error:#!/usr/bin/perl -w use strict; ## usage information # $0 UPSNAME HOSTNAME DATAPOINT # where DATAPOINT can be any of # utility - the number VAC utility power is providing # loadpct - the percentage of the maximum load # battpct - percent of total battery charge available # runtime - approx. number of minutes of battery life my $lookfor = $ARGV[2]; my @upsinfo = (`/usr/local/bin/upsc $ARGV[0]\@$ARGV[1]`); my ($junk, $utility) = split /\s+/, $upsinfo[10]; my ($kunk, $loadpct) = split /\s+/, $upsinfo[14]; my ($lunk, $battpct) = split /\s+/, $upsinfo[21]; my ($munk, $runtime) = split /\s+/, $upsinfo[23]; if ($lookfor) { print $$lookfor; } else { print "utility is $utility\n"; print "loadpct is $loadpct\n"; print "battpct is $battpct\n"; print "runtime is $runtime\n"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: scalar dereferencing
by snowcrash (Friar) on Sep 11, 2001 at 10:42 UTC | |
by jamgill (Acolyte) on Sep 11, 2001 at 23:41 UTC | |
|
Re: scalar dereferencing
by busunsl (Vicar) on Sep 11, 2001 at 10:18 UTC |