my $new_string = testing_string($string); sub testing_string { my $content = $_[0]; # do some stuff $content =~ s/a/b/sg; return $content; }