in reply to Re^3: identifying null fields in bar delimited records
in thread identifying null fields in bar delimited records
The "-1" at the end will preserve trailing null fields, so if the input always has a consistent number of field separators on every line, the number of elements assigned to @fields will always be the same. Then it's easy to just step through the array to check for undef elements.my @fields = split( /\|/, $_, -1 );
|
|---|