$ perl -wl $x = "abc"; for $z (substr($x,1,1)) { print ":$z:"; $z = "zz"; print ":$z:" } __END__ :b: :z: