note
davorg
<p>All very kludgy, but you could do something
like the following. Remember that the first
parameter to an object method must be a reference
to an object of the right type.</p>
<code>
#!/usr/bin/perl -w
use strict;
package Thing;
sub new {
bless {}, shift;
}
sub say {
print "@_[1 .. $#_]\n";
}
package main;
my $thing = Thing->new;
$thing->say('Hello', 'World');
my $say = \&Thing::say;
$say->($thing, 'Goodbye', 'All');
</code>
62737
62737