Quote:
Originally Posted by ghostdog74
another one.
Code:
use Data::Dumper;
use Linux::SysInfo qw/sysinfo/;
my $si = sysinfo;
print Dumper($si);
|
I doubt that this will work on my OpenBSD laptop, thats why I asked portable ways to do this.
Currently trying to find portable way to get battery info but no luck so far.
I'm having some grand idea to write the C code to get battery info to the libstatgrab and update the perl bindings but that will take some time with my 'aw3some' l33t hax0r skillz'
Meanwhile some other way to do this is needed. Probably the quickest way would be to test OS and then parse /proc/acpi/battery or apm output.
But could you help debug a small issue with my mail count info.
I'm trying to connect to remote server ( or localhost) running dovecot that serves my maildirs through IMAP. It doesn't allow plaintext authentication so I need the SSL stuff.
Code:
use Mail::IMAPClient;
use IO::Socket::SSL;
# Doesn't work yet
sub new_msgs {
my $imap = Mail::IMAPClient->new
( User => $username,
Password => $pass,
Socket => IO::Socket::SSL->new
( Proto => 'tcp',
PeerAddr => $server,
PeerPort => 993,
),
);
#$imap->connect or die "Could not connect: $@\n";
my $msgcount = $imap->message_count($mail_folder); # line 75
defined($msgcount) or die "Could not message_count: $@\n";
return $msgcount;
it gives following message:
Code:
Not connected at status.pl line 75
Error sending '1 STATUS INBOX (MESSAGES)' to IMAP: Connection refused at status.pl line 75
Could not message_count: Error sending '1 STATUS INBOX (MESSAGES)' to IMAP: Connection refused
I can't figure out whats the case is here. First line states that it is not connected but the last line states that the connection was refused. I'd think it can't be both.
If I uncomment the 'connect' line it gives following
Code:
Could not connect: Unable to connect to : Invalid argument
Any suggestions how to get this working?
Edit: ha, got it working after googling for this a bit and found
this.