in reply to Substitution or removing characters from a file
Sure, just remove the newline:
Or$basename =~ s/\S*RDL/RDL/; $basename =~ s/.ruv$//;
Ors/\S*RDL/RDL/, s/.ruv$// for $basename;
but why would you? The two lines are easy to understand, and certainly more efficient that the latter single substitution.$basename =~ s/\S*RDL((?s:.*)).ruv$/RDL$1/;
In Section
Seekers of Perl Wisdom