in reply to Howto return a reference of an array of custom class?
The line
$_.p()
likely isn't doing what you think it does. See perlop for the Perl operators. The dot (.) is the string concatenation operator. So you're concatenating your object with the result of the function p, which is not defined, hence the error message undefined subroutine &main::p. Maybe you wanted the arrow operator -> to call a method?
|
|---|