| Acme-MetaSyntactic documentation | Contained in the Acme-MetaSyntactic distribution. |
Acme::MetaSyntactic::any - Items from any theme
This theme simply selects a theme at random from all available themes, and returns names from it.
The selection is done in such a manner that you'll see no repetition in the items returned from a given theme, until all items from the theme have been seen.
Create a new instance.
The parameters will be used to create the underlying Acme::MetaSyntactic object, and will be passed to the randomly chosen theme. This can be useful for themes deriving from Acme::MetaSyntactic::Locale.
Implement the name() method for this class.
Return the theme name (any).
Always return false.
Philippe Bruhat, upon request of Sébastien Aperghis-Tramoni.
Introduced in version 0.12, published on March 7, 2005.
Updated to conform with interface changes required by
Acme::MetaSyntactic::Updatable in version 0.49, published
on November 21, 2005.
| Acme-MetaSyntactic documentation | Contained in the Acme-MetaSyntactic distribution. |
package Acme::MetaSyntactic::any; use strict; use List::Util 'shuffle'; use Acme::MetaSyntactic (); our $Theme = 'any'; sub import { # export the metaany function my $callpkg = caller; my $meta = Acme::MetaSyntactic::any->new(); no strict 'refs'; *{"$callpkg\::metaany"} = sub { $meta->name( @_ ) }; } sub name { my $self = shift; my $theme = ( shuffle( grep { !/^(?:any|random)$/ } Acme::MetaSyntactic->themes() ) )[0]; $self->{meta}->name( $theme, @_ ); } sub new { my $class = shift; # we need a full Acme::MetaSyntactic object, to support AMS::Locale return bless { meta => Acme::MetaSyntactic->new( @_ ) }, $class; } sub theme { $Theme }; sub has_remotelist { }; 1;