Subject: | Fwd: Net-Wireless-802_11-WPA-CLI-2.1.0 |
Date: | Mon, 03 Aug 2015 10:14:35 -0800 |
To: | bug-Net-Wireless-802_11-WPA-CLI [...] rt.cpan.org |
From: | leif <leif [...] denali.net> |
Hi there!
Ran into your package on CPAN looking for interfaces to wpa_cli,
and think i see a bug:
It looks like the sub ->new is calling "wpa_cli status" after init,
but isn't testing the right variable
#tests if it is usable.
my $command='wpa_cli '.$self->{socket}.' status';
my $status=`$command`;
if (!$? == 0){
$self->{error}=1;
However, if I change that error assignment line like this:
$self->{error}=$?;
then what I see on the console is:
Net-Wireless-802_11-WPA-CLI new:-1: "wpa_cli status" failed with
"Selected interface 'wlan0'
followed by the rest of the status.
Why it's returning -1? i don't know. Because:
# foo=$(wpa_cli status); echo $?
0
Any thoughts or suggestions of where to start troubleshooing?
Thanks.
Leif