#!/usr/bin/perl $a = "Hello, this is a test."; # attempt to substitute "was" for "is", case sensitive $a =~ s/is/was/; print "$a\n"; # Hello, thwas is a test. # try again... $a = "Hello, this is a test."; # attempt to substitute " was" for " is", case sensitive $a =~ s/ is/ was/; print "$a\n"; # Hello, this was a test. # global specifier "g" afterward will do all not just 1st one $a = "hi hi hi"; $a =~ s/hi/ho/g; print "$a\n"; # ho ho ho