in reply to cut of first char of a string
use strict; use warnings; use Math::BigInt; my $s = 'Hello World'; $s = reverse ((Math::BigInt->new('0b' . (unpack('B*', $s) & ('00000000' . ('11111111' x (length($s) - 1))))))->as_bin()) +; $s =~ s!b0!!; $s = reverse(pack('b*', $s)); print "'", $s, "'\n";
|
|---|