http://qs1969.pair.com?node_id=1176880


in reply to Re^2: split problem
in thread split problem

Use Devel::Peek with working/nonworking to see the difference

Sounds like a bug in perl

#!/usr/bin/perl -- use strict; use warnings; use Devel::Peek qw/ Dump /; eval { my $value = "A\tB\tC\tD\tE\tF"; my @flds = split(/\t/, $value); $flds[16] = undef; $flds[8] = 0; Dump( \@flds ); print scalar @flds, "\n", '#'x5,"\n"; 1; } or warn $@; eval { my $value = "A\tB\tC\tD\tE\tF\t\t\t\t\t\t"; my @flds = split(/\t/, $value); Dump( \@flds ); $flds[16] = undef; $flds[8] = 0; print scalar @flds, "\n", '#'x5,"\n"; 1; } or warn $@; __END__