Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Perl LSF module help

by ghosh123 (Monk)
on Jun 22, 2012 at 05:46 UTC ( #977777=perlquestion: print w/replies, xml ) Need Help??
ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:

Hi
In my program I am running a LSF command (lsload -I tmp2 ). The output of which comes as following :

mylogin: lsload -I tmp2 HOST_NAME status tmp2 blrlc264 ok 3e+04 blrlc260 ok 4e+05 blrlc256 ok 4e+05

Is there any LSF module/subroutine in PERL which I can use to determine the maximum value under the tmp2 command (above) for a particular host. Right now I am doing it as :

use List::Util qw/max/; my $cmd = `lsload -I tmp2`; my @arr = split("\n", $cmd ); shift @arr; my @size; foreach (@arr) { my @row = split(" ", $_); push @size, $row[-1]; } my $maxsize = max @size ;

Thanks

Replies are listed 'Best First'.
Re: Perl LSF module help
by frozenwithjoy (Priest) on Jun 22, 2012 at 05:54 UTC
Re: Perl LSF module help
by toolic (Bishop) on Jun 22, 2012 at 12:37 UTC
    FYI. backticks can also return a list.
    my $cmd = `lsload -I tmp2`; my @arr = split("\n", $cmd );

    can be simplified to:

    my @arr = `lsload -I tmp2`;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://977777]
Approved by Corion
help
Chatterbox?
[Corion]: Also, I think the OPs problem is on their intranet and not on the internet (also, they should likely use WWW::Mechanize instead, which knows about cookie)
[1nickt]: yes, could be.
[1nickt]: I don;t see the link , definitely, after reloading the node
[1nickt]: Is it possible to disable it?
[Discipulus]: if you mean [download] after the code it is there 1nickt
[1nickt]: yes, Corion sees it too, and I see it when not logged in.
[Corion]: I think you can disable download links in your settings?
[1nickt]: Looking in settings to see if I disabled it in my profile ...
[1nickt]: There is "Don;t show embedded d/l links" in Display settings. It is unchecked.
[1nickt]: Oh, there is a minimum lines setting!

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-05-23 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?