in reply to Error saying “Undefined subroutine xxx called at…”
Am I doing something wrong?
You're giving a description of your code, instead of giving actual code that shows the error
The error you get is simple/easy to understand, but a description of code isn't going to demonstrate the error
For example
$ perl -e" Demo(); " Undefined subroutine &main::Demo called at -e line 1. $ perl -e" sub demo {warn 666} Demo(); " Undefined subroutine &main::Demo called at -e line 1. $ perl -e" package Demo;sub Demo {warn 666}; package main; Demo(); " Undefined subroutine &main::Demo called at -e line 1.
The problem is obvious, first there is no Demo, then there is no Demo ("demo" is not "Demo"), then there is no Demo again
|
|---|