while (...) { my $raw_length = length($rows[0]); # Formerly named $ea my $encoded = unpack('H*', $rows[0]); ...do something with these vars... }