I have some Perl code, that has been running for a few years, and now, suddenly it will no longer function properly. I have put it thru the Perl Debugger and everything works fine - code wise. The issue is that it will no longer disply on the page. I have looked up __END__ and found that most every page says it is a "end of file" type of command, and all remaining lines will be skipped. I am not sure if I believe that or not, as this worked fine for years and nothing has changed on the code end. Here is the code:
#!perl use strict; use warnings; use File::Copy; print "Content-type: text/html\n\n"; my @servers = (); for my $i (1..9) { push @servers, "serverpd0${i}"; } push @servers, qw (serverpd15); for my $server (@servers) { my $audit_file = "\\\\$server\\c\$\\program files\\maintenance\\au +dit.txt"; if (-e $audit_file) { copy($audit_file, "tmp\\$server.log") or die $!; } } print "<pre>"; print system("cat.exe tmp\\*.log | c:\\wbin\\sort.exe -k 3 -r"); print "</pre>"; exit; __END__ print qq { <html> <body style="margin:0;padding:1px;"> }; print "<table width='100%' cellpadding='1' border='1' style='border:1p +x black solid;border-collapse:collapse;font-family:tahoma;font-size:1 +1px;'>"; print qq{ <tr style="background:black;color:white;font-weight:900;"> <td>Timestamp</td> <td>Username</td> <td>Where From</td> <td>Record Type</td> <td>Record Data</td> <td>Field Name</td> <td>Action</td> <td colspan="13">Data</td> </tr> }; for my $timestamp (reverse sort keys %logs) { for my $entry (@{$logs{$timestamp}}) { print "<tr><td>"; my @temp = split("\t", $entry); splice @temp, 1, 3; unshift @temp, $timestamp; print join("</td><td>", @temp); print "</td></tr>"; } } print qq{ </table> </body> </html> };
Can someone please tell me what the __END__ really does? if it is ignoring the remaining lines, why did it work for 2 years like this? What would be a better way to have this displayed on a IE page? Any assistance would be great!

In reply to Does __END__ really mean ignore rest of lines? by jaacmmason

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.