in reply to Re: Calling locally manufactured (typeglob) methods
in thread Calling locally manufactured (typeglob) methods
I can only imagine what the problem is since you didn't describe it but I am guessing that perhaps you goofed by returning $_ instead of $method. $_ is a global and when you call it will have values unrelated to the 0..9 you named your methods after.
I would like to offer you a bit of hope in your method names. In theory, you can name your methods just about anything. Your calling syntax may not be pleasant or usual but it does not become impossible just because your identifers no longer match /^[_[:alpha:]]\w*\z/ or /^\p{IdStart}\p{IdContin}*\z/.
$method = '1'; $obj->$method; # Works! $obj->1; # Doesn't work!
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|