How remove leading zeros

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+// }, […]

Read Me Leave comment

unpack vs substr

Recently I’ve decided to repalce using substr by unpack when I need to split data which are presented in a row with specified order. But after that I’ve made a test to see what way is the most efficient. The test displays that unpack is slower than substr about 30%! But on the other hand unpack makes a code more compact and clear. So, if […]

Read Me Leave comment

Raritets of the USSR photo chronicles

Raritets of the USSR photo chronicles – Great Domestic War 1941-1945 is a set of inconceivable photos! Highly recomended!

Read Me Leave comment

New Limassol theaters schedule

Only one new movie has started in the Limassol theaters at that weekend. It’s a comedy “Meet the Fockers” with Robert De Niro and Ben Stiller in key roles. Actually, this is a sequel of “Meet the Parents” where Forker (nice name) met with his girlfriend’s parents. So, I can suppose, the sequel story is about visit the parents to Forker’s home. I’ve watched “Meet […]

Read Me Leave comment