Given a code segment:

my $cmd = "/usr/symcli/bin/something";
open  (SYMCFG, " $cmd |" ) or die "cannot open $!\n";

while ( <SYMCFG> ) {
  #print $_ if /FibreChannel  Online$/ ;
  # extract fields from the matching line
  my ( $ident, $fa , $type, $status ) = (split )[0,1,4,5] if /
FibreChannel  Online$/ ;
  print $ident, $fa,$status;

}
close SYMCFG ;

the sample output of running  $cmd looks like:

Ident  Symbolic  Numeric  Slot  Type   Status

DF-1A     01A       1   1   DISK          Online
FA-4A     04A       4    4   FibreChannel  Online
FA-13A   13A      13   13   FibreChannel  Online

the question:
I would expect to print out the field 0, 1, 4, 5
from the above line, however, while the first 3 fields print OK, the
last field $status seem always got undefined and

Use of uninitialized value at ./emc_device_matching_to_fa.pl line 32,
<SYMCFG> chunk 23.

what I'm doing wrong?

Thanks.


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


Reply via email to