while (<>) { s+${SOURCE}/${SAMS}/++g; s+${SOURCE}/${SAMLIB}/++g; s+${SOURCE}/${SMCLIB}/+${SOURCE}/${KENO}/+g; if ( not m+^${SOURCE}/+ ) { s+${SOURCE}/+\$$\{OBJECT\}/+g; print } }