#!/usr/bin/perl -w $path = "/usr/bin"; # Change /usr/bin to /usr/local/bin. $path =~ s{/usr/bin} </usr/local/bin>; print "New path: $path.\n";