Thanks for your suggestion; I'll give it a try.
In the meantime, I figured out how to solve the problem; I just don't understand why.
The P::RD docs say:
"...since each rule is implemented inside a special namespace belonging to its parser,
it is necessary to explicitly quantify variables form the main package."
Therefore, I changed all variables to refer to the Main package. I.e., $str1 becomes $Main::str1, and now it works. But why it spits out this particular error message is beyond me.
Thanks...
"The only things that are difficult are thoese that I know nothing about" -- Mark Twain