use warnings; use strict; my $t0="01.00.01.004"; my @o0 = split /./, $t0; my @om1 = split /./, $t0,-1; use Data::Dumper; print " 0\n".Dumper(\@o0); print "-1\n".Dumper(\@om1);