#!/usr/local/bin/perl -w use strict; my $string = 'begin$end'; $string =~ s/\$/tmp/g; print "$string\n";