http://www.perlmonks.org?node_id=443123

How to produce random page titles in Catalyst:

=head2 auto # # A list titles, which will be # randomly used for each page title # # i.e. <title>[% page_title %]</title> # =cut sub auto : Private { my ( $self, $c ) = @_; my @titles = qw{ Test1 Test2 Test3 Test4 }; my $rand_title = $titles[ rand @titles ]; $c->stash->{page_title} = $rand_title; return 1; }
Put this in your MyApp.pm