That's probably the simplest and most useful advice - try out the bits of code in the small if you have any questions what they do. Whether in small test jig programs, in the debugger or typed-in on the command line, just try it out.
What does .*? mean? Try it with and without the '?' (pardon the Windows quoting):
perl -e " printf \"'%s'\n\", join \"', '\", '...tangled web was woven
+...'=~m/(.*?w)/ ;"
'...tangled w'
perl -e " printf \"'%s'\n\", join \"', '\", '...tangled web was woven
+...'=~m/(.*w)/ ;"
'...tangled web was w'
And even when you don't understand it, at least you'll know what it did ...