Dear Monks,

I take care of a small non-profit's website. I didn't build it. They have two applications (PHP and PERL) and they have asked me to streamline the logins. I don't know any PERL so I've been reading and decided that the best/easiest way for me would be to get the cookie data from the first application and put it into the text input of the second application's login (which uses HTML::Template).

My problem is with getting the cookies using 'sub cookies'.-- I can get them by running a Get-Cookie CGI without any problems. I *don't* want to store the cookies in a file if it is not necessary. Anytime I start a new module the application crashes. BTW, I'm not sure what I'm doing.

sub cookies { my $self = shift; my $cookies = CGI->new my $thetemplate = $self->load_tmpl('theform.html'); $cookies1 = $cookies{'AnyName1'}->value; $cookies2 = $cookies{'AnyName2'}->value; $template->param(COOKIE1 => $cookies1); $template->param(COOKIE2 => $cookies2); ); }
In the form <input type="text" name="state" value="<TMPL_VAR COOKIE1> "size=20 />

I have read so many ways and modules for accomplishing this that I am confused (HTML::Mason, WWW::Mechanize, LWP::UserAgent, etc).

I am so lost. What am I doing wrong?


In reply to Get Cookies for Form Input by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.