in reply to Re^2: removing Extra lines issues in arrays
in thread removing Extra lines issues in arrays

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.