develooper Front page | perl.fwp | Postings from April 2003

Variations on a theme

Thread Next
From:
Simon Cozens
Date:
April 13, 2003 14:41
Subject:
Variations on a theme
Message ID:
20030413214142.GA5040@deep-dark-truthful-mirror.pad
So the next obvious thing to do was...

 % cat Foo.pm 
package Foo;
use Acme::Dot; # Here be magic.
sub new { return bless {}, $_[0] }
sub test { print "I am Foo's test method, and my arguments are: @_\n"; }
1;

 % perl -MFoo -e ' my $x = Foo->new; $x.test(1,2,3);'
I am Foo's test method, and my arguments are: Foo=HASH(0x4c59c) 1 2 3

Acme::Dot still has a few problems, so I can't release it just yet, but
it's a neat idea.

-- 
sub UNIVERSAL::AUTOLOAD{ $UNIVERSAL::AUTOLOAD =~ s/::/ /; print
"$UNIVERSAL::AUTOLOAD "}; hacker perl another just;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About