bob ackerman writes:
[...]
> so:
> s|{(.*?)}|$1=~ tr///|xg;

I'm trying to test this myself on a string (rather than $_), but don't 
understand how to use tr/// on $1 and then place the result back into the 
string (practice only).

I tried a sort of nested expression similar to what you show

$string =~ s|{(.*?)}|{$1 =~ tr/iw/JX/)}|xg;

It's supposed to capture the text between curly brackets and then do a 
transliteration (i-->J and x-->X)

but for: kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk {kdkdikdkddk}

I get: "kdkdkiwiwdkdkdk {iwidkwidkw =~ tr/iw/JX/} kdkdkdwiwiwkdkdk 
{kdkdikdkddk =~ tr/iw/JX/}"

which seems to demonstrate that my nesting doesn't work and that I don't 
know how to use tr///  :-(

-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to