Forum Moderators: coopster & phranque

Message Too Old, No Replies

New to Perl need help, please.

         

Charles_cz

3:22 am on Jan 1, 2004 (gmt 0)

10+ Year Member



Hi I am new to perl and I need your help. I can't figure out how to read cookies. It's probably very simple.

I have existing simple cookie with name User and value Mark.

I have script:


#!/usr/bin/perl
use CGI;
my $query = new CGI;
my $cookie_in = $query->cookie('User');
print "Content-type: text/html\n\n";
print "Value is $cookie_in";
exit;

If I execute script as part of *.shtml page

<!--#exec cgi="/cgi-bin/SSI-LastName.cgi"-->
I will get cookie value as I need. No problem there,

If I run the same script it self it will display blank page. It will not find the cookie. What do I have to do if I want to read cookie "User" in perl script and use value somwhere else in the script.

Why script can not read cookies unless I execute it in shtml file?

I really need help because I am new to cookies and I know just a little bit about perl.

Thank you Charles

pendanticist

2:45 am on Jan 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Friendly bump to clear up some of last year's stuff.