#!/usr/bin/perl use strict; use warnings; while () { my @parts = split /(\|[^\|]*\|)/; for my $part (@parts) { if ($part =~ /\|(.*)\|/) { my @chars = $part =~ /([\da-f]+)/ig; $part = join '', map{chr(hex($_))} @chars; } print $part; } } __DATA__ |30 31 32 33 34|.dropbox.com User-Agent|3A|Google|20 20|Desktop #### 01234.dropbox.com User-Agent:Google Desktop