I have just transferred a site over to a new server. The perl scripts were working just fine on the old server and now it seems to be having issues and outputting the header content to the screen.

When I fill out a login form that gets send to the script (below) I receive the following error:

------------------------ Set-Cookie: loggedin=confirmed; path=/; expires=Mon, 07-Dec-2009 07:56 +:19 GMT Date: Mon, 07 Dec 2009 07:46:19 GMT Refresh: 1, https://www.m +ydomain.com/EAM/cgi-bin/admin/messageadmin.pl?action=list Content-Typ +e: text/html; charset=ISO-8859-1 ------------------------
Below is the code for the script
START CODE ------------------------ use CGI; $q = new CGI; if (!$q->cookie('loggedin')) { if ($q->param('username') eq "XXXX" && $q->param('password') eq "XXX +X") { if ($q->param('action') && $q->param('id')) { $action = $q->param('action'); $id = $q->param('id'); $cookie = $q->cookie(-name => 'loggedin', -value => 'confirmed', + -expires => '+10m'); print $q->header(-cookie => [$cookie], -refresh => "1, https://w +ww.mydomain.com/EAM/cgi-bin/admin/messageadmin.pl?action=$action&id=$ +id"); } elsif ($q->param('action')) { $action = $q->param('action'); $cookie = $q->cookie(-name => 'loggedin', -value => 'confirmed', + -expires => '+10m'); print $q->header(-cookie => [$cookie], -refresh => "1, https://w +ww.mydomain.com/EAM/cgi-bin/admin/messageadmin.pl?action=$action"); } else { $cookie = $q->cookie(-name => 'loggedin', -value => 'confirmed', + -expires => '+10m'); print $q->header(-cookie => $cookie, -refresh => '1, https://www +.mydomain.com/EAM/cgi-bin/admin/messageadmin.pl?action=list'); } } } else { print $q->redirect('https://www.mydomain.com/EAM/cgi-bin/admin/messa +geadmin.pl'); } END CODE------------------------

I'm in a real bind and I have no perl experience. Any help would be greatly appreciated.

Many thanks
Lee


In reply to Outputs Headers after server change by iWire

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.