Can't use string as a symbol ref

2007-12-17 Thread ciwei2103
Can somebody enlighten me what I'm doing wrong? I have a list in a file , "test.dat" sh> cat test1.dat 0039 0038 sh> cat test1.pl #!/usr/bin/perl -w use strict; my $input = $ARGV[0]; my @devices = <$input> ; print "devices = @devices \n"; __END__ now run it with sh> test.pl test1.dat Can

to test maximum consecutive numbers

2007-12-11 Thread ciwei2103
Give a disk sequence know that is incrementing with base 16, such as , 0001 0003 0004 0008 0009 000A 000B 000F 0010 0011 how do I extract the a subset that is have at least 4 consecutives, such as "0008 0009 000A 000B" thanks. Jason -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

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

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$/

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$/

about ( .)

2007-11-27 Thread ciwei2103
can someone explain how this code segment works: # execute a command which may be on a local system or a remote system sub _lrdo { my ($cmd,$exec,$rtn); ($cmd) = (@_); $exec = (_localsys()) ? $cmd : "$SRSH{$SYS} $SYS $cmd"; $rtn=_do($exec); return "$rtn"; } sub _haconfmak