in reply to Re^4: substitute strings
in thread substitute strings

Well, there's your problem ... you need to learn the basics of programming first.

http://perldoc.perl.org/perlsyn.html

Play around with the lego blocks of syntax to get an idea of how they work and how they can fit together before you try to get fancier.