From the split documentation :
If the LIMIT is negative, it is treated as if an arbitrarily large LIMIT was given.
What does this mean if you do something like:
my @fields = split( /\$/, $record, -1 );
... then you will get blank fields for the last three entries in the list.
#!perl use strict; use warnings; use Data::Dumper; my $string = 'abc$$$'; my @fields = split( /\$/, $string, -1 ); print Dumper \@fields;
Fingerprints:
$VAR1 = [ 'abc', '', '', '' ];
source share