#!/usr/bin/perl -w use strict; my $foo = "a string"; print "before with: $foo\n"; for($foo) { s/a /not a /; } print "after with: $foo\n";