http://qs321.pair.com?node_id=969753


in reply to Substitution or removing characters from a file

Sure, just remove the newline:
$basename =~ s/\S*RDL/RDL/; $basename =~ s/.ruv$//;
Or
s/\S*RDL/RDL/, s/.ruv$// for $basename;
Or
$basename =~ s/\S*RDL((?s:.*)).ruv$/RDL$1/;
but why would you? The two lines are easy to understand, and certainly more efficient that the latter single substitution.