I get this error while using cookie_jar method:
Can't call method cookie_jar on an undefined value
Here is my code:
my $cookie_jar= new HTTP::Cookies;
my $ua=new LWP::UserAgent;
my %cookies= fetch CGI::Cookie;
my $encoded=$cookies{'SCred'};
$cookie_jar->set_cookie(1, "SCred", $encoded, "/", $SSO_DOMAIN, "", 0, 0, 60*60, 0);
$ua->cookie_jar($cookie_jar); # I get error on this line
Any idea why I get this error?