I had to make the following adjustments to the code for Windows/Apache:
(1) Change the session to YAML
#set 'session' => 'Simple';
set 'session' => 'YAML';
(2) Adjust the path for request->base:
# $tokens->{'css_url'} = request->base . 'css/dancr.css';
$tokens->{'css_url'} = request->base . '/css/dancr.css';
Everything with the app works as expected *except* for the "$flash message" code:
my $flash;
sub set_flash($message) {
my $message = shift;
$flash = $message;
}
sub get_flash {
my $message = $flash;
$flash = '';
return $message;
}
I suspect that since these subs are outside a route, perhaps I'm getting an effect about the scope of the variables... but calls to these subroutines do *not* set $flash or $message as expected:
template '
show_entries.tt', {
'msg' => get_flash,
set_flash('New entry posted!');
set_flash('You are logged in.');
set_flash('You are logged out.');
For each of these, the $flash variable (which is a free-standing global in the module) is never set... and so the get_flash sub never returns a value.