in reply to Unwanted empty value in array after Splitting a string

Straight from perldoc -f split
Splits the string EXPR into a list of strings and returns that list. By default, empty leading fields are preserved, and empty trailing ones are deleted.
The only exemption is the pattern split(' ',$str) so just add a grep
perl -MData::Dumper -e ' $str = "GTGNNTNNG"; @nseg = split(/[ATCG]+/,$str); @nseg = grep {/./} @nseg; print Dumper \@nseg;'


grep
Mynd you, mønk bites Kan be pretti nasti...