To assist you better, could you show some example output of the two commands show port and show port $PORT_NO detail that you are trying to parse?* Also, I see you're splitting on '\n', which is a literal backslash followed by a lower case n, is that intentional? If you meant to split on a line break, you should use "\n" (in double quotes, because those interpolate, single quotes don't).
* Perhaps the output of use Data::Dumper; $Data::Dumper::Useqq=1; print Dumper(\@port); and in the loop print Dumper($output_str);
In reply to Re: array and string split
by Anonymous Monk
in thread array and string split
by numele
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |