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

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

foreach (@newlist) { $_ =~ s/[.](.*)/($section) }

The above code performs the transform cat.1 ---> cat(1) It also performs the transform ls.so.conf.5 ---> ld(5) # which is WRONG! Is there a way to generalize this regex so it does: cat.1 ---> cat(1) ld.so.conf.5 ---> ld.so.conf(5) Thanks