in reply to Process a set num of characters at a time
Perhaps you want something like this:
$ perl -le' my $input_string = "test"; print substr( $_, 2 ), substr $_, 0, 2 for unpack( "H*", $input_string + ) =~ /.{1,4}/g; ' 6574 7473 [download]