Acme-123

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN


a) You must cause the modified files to carry prominent notices stating that you
changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in whole or in
part contains or is derived from the Program or any part thereof, to be licensed
as a whole at no charge to all third parties under the terms of this License.

c) If the modified program normally reads commands interactively when run, you
must cause it, when started running for such interactive use in the most ordinary
way, to print or display an announcement including an appropriate copyright
notice and a notice that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these conditions,
and telling the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an announcement,
your work based on the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be on
the terms of this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

lib/Acme/123.pm  view on Meta::CPAN

package Acme::123;
require Exporter; 

BEGIN {
    use Exporter ();
    use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
    $VERSION     = '0.04';
    @ISA         = qw(Exporter);
    @EXPORT      = qw(printnumbers setLanguage getnumbers);
    @EXPORT_OK   = qw();
    %EXPORT_TAGS = qw(@numbers);
}

my %languages = (
	'en' => [qw /one two three four five six seven eight nine ten/],
      'fr' => [qw /un deux trois quatre cinq six sept huit neuf dix/],
	'sp' => [qw /uno dos tres cuatro cinco seis siete ocho nueve diez/],
	'it' => [qw /uno due tre quattro cinque sei sette otto nove dieci/]
);
my @numbers = @{$languages {en}};

sub printnumbers {
	foreach (@numbers) {
		print "$_ \n";
	}
}

sub setLanguage {
	my $self = shift;
	my $language = shift;
	@numbers = @{$languages {$language}};
}

sub getnumbers {

lib/Acme/123.pm  view on Meta::CPAN


=head1 NAME

Acme::123 - Prints 1-10 in different languages

=head1 SYNOPSIS

	use Acme::123;
	my $123 = Acme::123->new;

	$123->printnumbers; #print English numbers

	$123->setLanguage('fr'); #sets language to French

	$123->printnumbers; #prints French numbers

=head1 DESCRIPTION

Prints numbers one through ten in different languages. Currently only
English, French, Spanish, and Italian supported. In later versions, more languages
will be supported.

=head1 TODO

	Support for many more languages.



( run in 1.678 second using v1.01-cache-2.11-cpan-de7293f3b23 )