my $string = "/mydirectory/directory/test/z2.htm"; my $foo = substr($string, 23, 100); print $foo;