http://www.perlmonks.org?node_id=999933


in reply to use of $sub

The string $SUB only shows up in that code once. You probably get a warning message like:
Name "main::SUB" used only once: possible typo
Generally, variables are expected to be assigned a value before they are used. Use diagnostics to get more information.
Also wondering what "smdr" in the error message refers to.
What error message? You should post the exact error message you are receiving, as well as at least a snippet of the relevant code.