if ( $str =~ /Hulk hate \w+/ ) { # $-[0] == 0 # $+[0] == 19 my $word = substr $str, $-[0] + 10, $+[0] - $-[0] + 10; # $word is now 'classless' =pod [An update. Hue-Bond points out that I should have said $+[0] - $-[0] - 10 instead. Whoops. I just leave this as a note to how easy it is to get this stuff wrong when you do it by hand. This is the kind of error you could find yourself in when you try this optimization. You were warned] =cut }