Perl Assistance with multiple array lines and pulling values -


i new forms , perl scripting, , need below:

i have script logs alcatel lucent devices , initiates below:

my $cmd = "cltcmd shortloc metric 5 detect"; print "$cmd\n" if $debug1; $s->cmd(string => "$cmd\n", prompt  => "/$enableprompt/"); sleep 5; $cmd="\n";  @lines4 = $s->cmd(string => $cmd,                 prompt  => "/$enableprompt/",                 timeout => 10); @lines4 = grep(/\s/, @lines4); <- removes blank lines. foreach $lines4 (@lines4) {     next if $lines4 =~ /sd12298a_lct>|clt operation completed.|log|copper/; <- remobed other non wanted text.     print $lines4 if $debug1;     $line4 = $lines4;     print $line4; } 

if print $lines4 correct output being 2 lines of text:

cltcmd dmmall ohm 5 100   resistance (t-r) 999999999 (t-s) 999999999 (r-s) 999999999 ohm   999999999 indicates out of range result 

but if print $line incorrect output being 1 line of text:

cltcmd dmmall ohm 5 100   999999999 indicates out of range result 

i understand why happening not how fix it.

what trying grab values array , put them individual variables being:

"resistance" "(t-r)" "999999999" "(t-s)" "999999999" "(r-s)" "999999999" 

but having no luck.

thanks,


Comments