#!/usr/bin/perl use strict; use warnings; # given: string of bytes # return: hexdump of argument sub hexdump ($) { use bytes; my @bytes = map {[$_, ord]} split //, shift; return '['.join(' ', map {sprintf('%02x', $_->[1])} @bytes).']' .'|'.join('', map { ($_->[1] >= 0x20 && $_->[1] < 0x7F) ? $_->[0] : '.' } @bytes).'|' } use utf8; my $text = q[search/¿Cuales son las partes de una cadena de conexión??scope]; print hexdump($text), "\n"; __END__