Hi John,
you asked...
> $_ = "Señor";
> s~([\x80-\xFF])~$1---~g;
> print; # Señ---or
>
> I want to evaluate ord($1) and then look up in a table that will give
> me "0x00F1" so that I can print Señ[0x00F1]or.
Maybe something like...
$_ = "Señor";
%table=(150=>"[0x00F1]",
151=>"[0x00F2]"); #whatever the mappings are
s~([\x80-\xFF])~$table{ord($1)}~ge;
print;
will get you started. The key is the "e" modifier on the substitute, which
evaluates the expression in the second slot (in order for the "ord" function
to, err, function).
Cheers,
Paul