Acme::Dot - Call methods with the dot operator
package Foo; use Acme::Dot; sub new { bless {}, shift } sub hello { print "Hi there! (@_)\n" } package main; my $x = new Foo; $x.hello(1,2,3); # Calls the method $y = "Hello"; sub world { return " World!"} print $y.world(); # Behaves as normal
This module, when imported into a class, allows objects of that class to have methods called using the dot operator as in Ruby, Python and other OO languages.
However, since it doesn't use source filters or any other high magic, it only affects the class it was imported into; objects of other classes and ordinary scalars can use concatenation as normal.
Occasionally has problems distinguishing between methods and subroutines. But then, don't we all? This will be fixed in the next release.
Simon Cozens, simon@cpan.org
simon@cpan.org
Copyright 2003 by Simon Cozens
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Acme::Dot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Dot
CPAN shell
perl -MCPAN -e shell install Acme::Dot
For more information on module installation, please visit the detailed CPAN module installation guide.