in reply to Searching on the Key Field of a Hash

Your description is not consistent with your code. There are no hashes in your code.

What do you expect $1 to contain in the die statements?

You should use strict; and use my so the scope of variables is a little more obvious.

What do you expect /(Figure\s+\W*)/i to match against? It is testing $_ which is probably undefined at that point.


DWIM is Perl's answer to Gödel