The most efficient way to remove leading zeros from some number is add to that number 0: 1 #! /usr/bin/perl -w 2 3 use strict; 4 use Benchmark; 5 6 my $test = ‘000000000000001’; 8 timethese shift, 9 { 10 Add => sub { my $num = $test; $num += 0 }, 11 Regex => sub { my $num = $test; $num =~ s/^0+// }, […]