JupiterHost.Net wrote:
[EMAIL PROTECTED] wrote:

yes I agree I was a little ambiguous... I was in a hurry. sorry. Anyway

Then do it at a later time and do it right, I imagine most all of us are busy also :)


here is my updated code. and here is a sample output:
My goal is to get all F01 which I am but I am having issues capturing all

Then you're doing a rube goldberg if that is indeed what you're trying to do:


# untested and prolly even more efficient way but it
# illustrates enhancements to the original code

#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;

$ENV{PATH} = '/opt/SUNWsamfs/sbin:/usr/bin:/usr/sbin:/usr/local/log';
open V4, 'samcmd v4 2>&1 |' or die "unable to open pipe: $!";

my @last_col;
for(<V4>) {
    chomp;
    my @tmp = split /\w+/;
    push @last_col, $tmp[ $#tmp ];
}

close V4;
print Dumper [EMAIL PROTECTED];

now @last_col has all of the F01... pieces of data.

You do realize that the characters 'F', '0' and '1' are included in the character class \w which split() is removing? :-)



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to