[Catalyst] flash and Template::Stash::ForceUTF8

Angel Kolev ankolev at gmail.com
Sat May 17 08:57:36 BST 2008


Hello, group.
I use 'flash' to share some params across the sessions and then redirect.
sub edit : Local {
    my ( $self, $c) = @_;
    my $edit = $c->request->params->{section}|| $c->flash->{section}|| "";
    ....
    ....
    $c->flash->{section} ='Pricing';
    $c->res->redirect($c->uri_for('/clients/edit')); # redirect to the 
same place but with different params
}
I use Template::Stash::ForceUTF8 and get following error when i try to 
fetch $edit:

undef error - flash takes a hash or hashref at 
/usr/local/share/perl/5.8.8/Template/Stash/ForceUTF8.pm line 12

Here is the line of Template::Stash::ForceUTF8:

sub get {
    my $self = shift;
    my $result = $self->SUPER::get(@_);  ### Line 12
    return $result if ref $result;

    Encode::_utf8_on($result) unless Encode::is_utf8($result);
    return $result;
}

Is this a bug or the problem is in my code?
Thanks



More information about the Catalyst mailing list