On the basis of replace text with function ? and similar, a version of s///(g) that takes a code ref as the second half of the construct (somehow) and calls the subroutine with @_ aliased to the current captures:
sub transform ( $_[ 0 ] = 'tripped'; } ... $text =~ s[cow\s+(jumps)\s+over][\&transform]rg; ## /r for 'ref'?
In reply to Re: what would you like to see in perl5.12?
by BrowserUk
in thread what would you like to see in perl5.12?
by ysth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |