OK, let's address this item by item.
- Modern::Perl: you can replace this by use strict; use warnings; and replace say by print + "\n".
- What version of Perl are you using?
- You can use any regex that works (but see point 5).
- My code does not need an else part.
- Of course it does not work, the regex you use is wrong. Use the following regex: my $match = qr "module\s*($ARGV)\b";. That one works, trust me. It is similar to my previous once, but will reject modulenames that are not exactly the same, but only start with the string you want to replace. It will accept "OLD" but will reject strings like "OLDER", "OLDENBERG", "OLDUVAI",...
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics