$ cat foo.pl my $t='the quick red fox jumped over the lazy brown dog.'; if ($t=~/fox(.{10})/) { print "The 10 characters after fox are '$1'\n"; } $ perl foo.pl The 10 characters after fox are ' jumped ov'