in reply to Functions in substitutions (s///) and Perl 5.8.
This code works fine for me.
On which platform are you running?#!/usr/local/bin/perl require 5.008; use strict; my $helper=sub { print @_ }; $_="[[This]] [[is]] [[a]] [[test]]"; s/(\w+)/$helper->($1)/eg;
|
|---|