my $sepArg = shift @ARGV; my ($hex) = $sepArg =~ /\\x([\da-fA-F]+)/; my $sep = chr hex $hex; my $str = "field1 $sep field2";