This is working ok, when I run the script through the commandline, but through a cronjob, it does not return anything for top? Why will this work through commandline and not through cron?
Fixed it, I added
use Image::ANSI::Parser;
But now it says:
Use of uninitialized value in split at /usr/lib/perl5/site_perl/5.8.3/Image/ANSI/Parser.pm line 139.
Can't call method "attr" on an undefined value at /usr/lib/perl5/site_perl/5.8.3/Image/ANSI/Parser.pm line 389.
Any ideas?
Thanks, I installed that but I getting this error:
# ./load.pl
Can't locate object method "new" via package "Image::ANSI::Parser" (perhaps you forgot to load "Image::ANSI::Parser"?) at ./loadlog.pl line 11.
Im my code I have:
$top2=qx[top -n1];
my $parser = Image::ANSI::Parser->new;
$top =...
When I email the output of top to my self it contains a bunch of forgien characters that dont appear if I just output it to the screen. How can I get it not to show thos characters? IE start with "top" and not "[H[J[?7l[mtop"
[H[J[?7l[mtop - 09:56:47 up 6 days, 5:38, 2 users, load...
How can I go through a c-block of IP's and see which ones ping?
I want to find available IP's how can I use perl to print the ips in a cblock that dont ping?
This will write to the end of a file but how do I write to the beginning of the file without losing the contents already in that file?
open HTML, ">>c:/web/root/index.html";print HTML "Content-Type: text/html\n\n";
print HTML "<html><head></head><body>";
print HTML "<h2>Written by Perl!</h2>"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.