| Acme-Orange documentation | Contained in the Acme-Orange distribution. |
Acme::Orange - Like Acme::Colour but only for important colours
$c = Acme::Orange->new();
$colour = $c->colour; # orange
$c->add("orange"); # $c->colour still orange
$c->add("blue"); # $c->colour still orange.
$c = Acme::Orange->new("pink");
$colour = $c->colour; # orange.
The Acme::Orange module provides the same interface as Acme::Colour, but restricts itself to important colours
Methods are as Acme::Colour
Acme::Colour by Leon Brocard
Acme::Tango by Peter Sergeant
Can't do overloaded constants. Yet
Nicholas Clark, <nick@talking.bollo.cx>
Copyright 2003 by Nicholas Clark
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Acme-Orange documentation | Contained in the Acme-Orange distribution. |
package Acme::Orange; use Acme::Colour; use 5.004; use strict; require Exporter; use vars qw($VERSION @ISA); @ISA = 'Acme::Colour'; $VERSION = '0.03'; sub default { return 'orange'; } sub new { my $class = shift; my $colour = shift; if (defined $colour) { undef $colour unless $colour =~ /orange/i; } # I can't remember if there is a better way to do this with SUPER:: # Patches welcome... Acme::Colour::new ($class, $colour, @_); } sub closest { return 'orange'; } *_closest = \*closest; __END__