For one thing if the two strings are coming from an outside source you've just given them a means to call an arbitrary method in your code; granted it's not a gaping hole, but that's generally enough to raise the hackles of the security conscious.
That aside, there's also no error checking so if anything does go wrong you merely get the generic "unknown method" error message. Better would be to explicitly validate that it's an allowed method name (either through a dispatch table or hash of valid method names, or at the least through using $obj->can( $method_name ) to check that the method will be callable). If it's not then you can explicitly print your own error message with the two distinct parts of the method name (so you don't have to go diving through the debugger to try and determine if someone tried to call with "xxy4" and "4", or "xxy" and "44", or "xx" and "y44", or . . . ).
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re^3: method invocation syntax at perl
by Fletch
in thread method invocation syntax at perl
by braveghost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |