in reply to Unwanted empty value in array after Splitting a string
As the gang has already pointed out, the documentation for split dispells the mystery. If you're trying to eliminate all empty fields, the grep trick that BrowserUk illustrated is a good solution. But if you're only trying to eliminate one or two (or a few) leading empty fields, you can do this:
shift @nseg until length $nseg[0];
...of course that's not going to help if @nseg contains nothing but empty fields. ;)
Dave
|
|---|