No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Chromatic's OO way I wouldn't really call that an OO way. Sure, it uses can as a class method on main, but that's where the OOishness ends. It returns a plain coderef and executes it with a different dereferencing syntax than you used. I believe it is also the only alternative that does not use a symbolic reference. To reinforce the point about being a plain coderef, this works:
And this does too, if you really want to get rid of all the pointy arrows:
Update: and if you want to see what I would consider the "OO way":
But, frankly, I think that's very ugly. It uses a symbolic reference too. I would use can as chromatic originally did. In reply to Re^3: Canon concerning coderef calls?
by revdiablo
|
|