Re: extracting fields from a matching line

2007-12-04 Thread John W . Krahn
On Tuesday 04 December 2007 07:28, ciwei2103 wrote: > thans for the reply. > > I modify the program a bit , the $cmd output looks like: > >Ident Symbolic Numeric Slot Type Status > > DF-1A 01A 1 1 DISK Online > FA-4A 04A

Re: extracting fields from a matching line

2007-12-04 Thread ciwei2103
thans for the reply. I modify the program a bit , the $cmd output looks like: Ident Symbolic Numeric Slot Type Status DF-1A 01A 1 1 DISK Online FA-4A 04A 4 4 FibreChannel Online FA-13A13A 13 1

Re: extracting fields from a matching line

2007-11-29 Thread John W . Krahn
On Wednesday 28 November 2007 16:07, ciwei2103 wrote: > > Given a code segment: > > my $cmd = "/usr/symcli/bin/something"; > open (SYMCFG, " $cmd |" ) or die "cannot open $!\n"; > > while ( ) { > #print $_ if /FibreChannel Online$/ ; > # extract fields from the matching line > my ( $ident,

re: extracting fields from a matching line

2007-11-29 Thread ciwei2103
Given a code segment: my $cmd = "/usr/symcli/bin/something"; open (SYMCFG, " $cmd |" ) or die "cannot open $!\n"; while ( ) { #print $_ if /FibreChannel Online$/ ; # extract fields from the matching line my ( $ident, $fa , $type, $status ) = (split )[0,1,4,5] if / FibreChannel Online$/