in reply to Re^2: Using perlclass 'methods'
in thread Using perlclass 'methods'
Thanks for the fix!
This is also a showcase some quirks of the Perl language:
- Parentheses are optional after method and subroutine calls. A method needs at least one parameter, and it was not provided with the $self-> syntax, so Perl picks up whatever comes next.
- The * is a valid (but fortunately rarely used these days) sigil. It is not a multiplication here, but indicates a glob reference.
- Really quirky: Spaces are allowed between a sigil and its identifier. So the identifier of * $rim is $rim, which is a symbolic reference.
use v5.40.0 implies "strict refs", so Perl complains about *$rim even before trying to use it as the invocant of the method (as I originally thought).
|
---|
In Section
Seekers of Perl Wisdom