use strict; my $code = do {local $/;}; $code =~ s/(\w)\.(\w)/$1->$2/g; $code =~ s/(? 'new', get_set => [ qw /foo bar baz / ];