I'm working on a Perl module and whenever I call the skip()
method I wrote in the following way:
$cursor->skip(4);
I get:
Undefined subroutine &MyModule::Cursor::skip called at t/tester.pl line 24. (in cleanup) invalid object at t/tester.pl line 24.
When I call it like:
MyModule::Cursor::skip($cursor, 4);
Perl finds it!
Oddly, if I name "skip
" anything else ("skipper
", "hello
"), this syntax works:
$cursor->skipper(4);
I thought maybe skip()
was a "secret" reserved key word or something, but I've also got methods named sort()
and next()
(which I know are reserved), and those work fine.
I'd really like to name this method "skip
." Does anyone know why Perl can't find it?