C:\test>p1 $s = 'This is a string (with a bit in the middle) before the string ends';; $r = \substr $s, 18, 24;; print $$r;; with a bit in the middle $$r =~ s[([a-z]+)][\U$1]g;; print $s;; This is a string (WITH A BIT IN THE MIDDLE) before the string ends