splice in Perl is weird