Perhaps something like...
my @list = grep { length } map { chomp } qx(p4 -p $P4PORT groups);
The map {chomp} part applies chomp to each item in the list (which strips trailing line break characters).
The grep {length} part then filters out any zero-length strings.
In reply to Re^3: removing Extra lines issues in arrays
by tobyink
in thread removing Extra lines issues in arrays
by rajeshatbuzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |