I have this data row with 20 fields:
my $data = '54243|601|0|||0|N|0|0|0|0|0||||||99582|';
I use this to split data:
my @data = split ('\|'), $data;
However, instead of 20 pieces of data, you get only 19:
print scalar @data;
I could manually pushempty the string on @dataif the last character is this |, but I wonder if there is an easier way.
source
share