in reply to Need Help Refactoring Method Calls

rhesa's solution is the best one. However, if you absolutely have to take a reference to a method, you will want to do it this way:
my $meth = My::Class::XXX->can( 'new' ); my $method = sub { $meth->( 'My::Class::XXX', @_ ); };

If you don't understand that syntax, don't use it. If you do, that's how you take a reference to a method.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Need Help Refactoring Method Calls
by merlyn (Sage) on Feb 02, 2006 at 17:07 UTC