I always find myself writing code like this:
my $var = $result[0];
my $var_changed = $var;
$var_changed =~ s/somepattern/somechange/g;
What would be a better way to do this? And by ‘better’ I mean: less typing while remaining understandable.
Thanks.
This would do the same thing as the second and third lines;
How legible it is is your call.