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