For me the following lines works fine: use CGI::Cookie; my $cookie = new CGI::Cookie(-name =>'NAME', -value => 'VALUE', -path => '/',-expires => '+1M',);
Try with use CGI::Cookie instead use CGI (error message must say 'perhaps you forgot to load "CGI::Cookie"?'). As last chance, did you try reinstalling the CGI::Cookie module ? ByeZ El Wednesday 24 December 2003 03:11 S D dijo : > I have this piece of code running AccessController.om > running using mod_perl : > > ------ > my $cookie = CGI::Cookie->new(-name => 'sessid', > -value => {XYZ => '321312'}, > -expires => '+1M'); > ------ > This throws following error : > ===== > Can't locate object method "new" via > package"CGI::Cookie" at > /opt/ora9/product/9.2/Apache/perl/lib/site_perl/5.005/i686-linux/Apache/My/ >AccessController.pm line 17. > ===== > > The CGI module IS included in script ( use CGI). > I also tried alternatives like "CGI::Cookie::new" / > "new CGI::Cookie" as suggested somewhere, but nothing > seems to work. > > What seems to be the error ? > .. > > Well, an elementary thing; but I've not found a > working example for setting/getting cookies yet & I'm > short on time. > > All the examples I found were for using CGI - however > I'm using 'mod_perl', hence I guess many of the things > do not work in such a Perl module. > > If you have / know location of any examples for > setting/getting cookies ** through an Apache - Perl > module deployed via mod_perl **, can you please let me > know ? ( using Apache::Request object ) > > > Thanks, > S > > > __________________________________ > Do you Yahoo!? > Protect your identity with Yahoo! Mail AddressGuard > http://antispam.yahoo.com/whatsnewfree -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html