in reply to Re^2: Finding Usable Nodes in our Cluster
in thread Finding Usable Nodes in our Cluster
print $_ foreach(@open);
You don't really need the loop there:
print @open;
And it might be better if you used strings instead of arrays:
use strict; use warnings; my $zero = "\nZero Active Processors:\n\n"; my $one = "\nOne Active Processor:\n\n"; foreach ( `ganglia proc_run` ) { $zero .= $_ if /\s0\s+$/; $one .= $_ if /\s1\s+$/; } print "$zero$one\n";
In Section
Cool Uses for Perl