in reply to Transforming only parts of input

This doesn't answer your perl question, but is hopefully helpful advice.

First, "New to perl" doesn't describe your problem. To get a better response, try creating a more descriptive title, such as "Parsing makefiles" or "Extracting path names from a text file".

Second, you have posted your last several questions in the wrong section. If you post quick questions like the above in Seekers of Perl Wisdom, you will get a better response. Thanks,

-Mark