Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Nothing special. Isn't that what Perls all about?

by merlyn (Sage)
on May 24, 2001 at 00:28 UTC ( #82716=note: print w/replies, xml ) Need Help??


in reply to Nothing special. Isn't that what Perls all about?

Or, more succinctly:
#!/usr/bin/perl use LWP::Simple; use HTML::TableExtract; my $html = get "http://www.efd.lth.se/loginload.shtml" or die "Cannot get!\n"; my $te = HTML::TableExtract->new(headers => ['Name', 'Load average']); $te->parse($html)->eof; my @sorted = sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } $te-> +rows; for (@sorted) { print "$_->[0] has load of $_->[1]\n"; } print "exec ssh $sorted[0][0]\n";

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Nothing special. Isn't that what Perls all about?
by Beatnik (Parson) on May 24, 2001 at 01:27 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://82716]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-11-24 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?