Please see the below code.
use strict;
use warnings;
use CGI;
use vars qw($a);
$a=new CGI;
use Catalyst qw/
Session
Session::Store::FastMmap
Session::State::Cookie
/;
#@_=("1","2");
my ( $self, $c ) = @_;
print $c->session->{foo} = "bar";
The file named as session.pl. When I run the above code(session.pl) I got the errors as given below in the server error log file.
1. Can't call method "session" on an undefined value at /var/www/
+birdbreeders/session.pl line 14
2. Premature end of script headers: session.pl
Please someone help me to clear the error.