use strict; use warnings; use Test::More tests => 1; my $have = '6578616d706c652e6d65'; my $want = '6578616d706c652e6d650000'; my $mult = 8; my $padchar = '0'; my $padlen = length ($have) % $mult; $have .= $padchar x ($mult - $padlen) if $padlen; is $have, $want;