Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • $method = \&Object::method;

    Hardcoding considered suboptimal (for a range of reasons). You want this:

    $method = $object->can( 'method' );

    You have to remember to pass a reference to $object in either case, though. No getting around that in Perl.

    Therefore you would normally use a closure as per Dominic’s suggestion.