http://www.perlmonks.org?node_id=997235


in reply to Need help to substitute

like so:

use warnings; use strict; while (<DATA>) { chomp; print "before change: ", $_, $/; s/(.+?)install.+?\\(.*?)/$1install\\$2/; print "After change: ", $_, $/; } __DATA__ D:\ostore_7.3.0_tfix_bld\install_temp\OStore\bin\os_coll.adb D:\ostore_7.3.0_tfix_bld\install_patch\osji\lib\osjiload.ldb

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me