in reply to example 7.pl

Tip #1 from the Basic debugging checklist:

use diagnostics;
This gives you a more verbose explanation of those errors.