# To get the position of first occurance of "SmcRel30Story" if ($tmp =~ /SmcRel30Story/) { print 'position of SmcRel30Story is ', 1 + length $`, "\n"; } # To extract everything inside the href if ($tmp =~ /href="(.+?)"/i) { print "I found this inside the quotes: $1\n"; }