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/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Substitution or removing characters from a file
by Anonymous Monk on May 17, 2012 at 22:58 UTC | |
by hary536 (Novice) on May 17, 2012 at 23:02 UTC |
In Section
Seekers of Perl Wisdom