Acme-Hello

 view release on metacpan or  search on metacpan

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


=cut

sub new {
    my ($class, %args) = @_;
    $class = ref($class) if (ref $class);

    $args{lh} ||= Acme::Hello::I18N->get_handle($args{language})
        or die "Cannot find handle for language: $args{language}.\n";

    return bless(\%args, $class);
}

sub hello {
    my $self = ref($_[0]) ? $_[0] : __PACKAGE__->new;

    print $self->loc("Hello, world!"), "\n";
}

sub lh {
    my $self = shift;

lib/Acme/Hello/I18N.pm  view on Meta::CPAN

else {
    @ISA = 'Acme::Hello::I18N::_stub';
}

package Acme::Hello::I18N::_stub;

sub new {
    my ($class, %args) = @_;
    $class = ref($class) if defined(ref $class);

    return bless(\%args, $class);
}

sub maketext {
    my ($self, $str, @params) = @_;

    return $str;
}

1;



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