I've heard anecdotal evidence about the fact that certain Perl CGI scripts running fine under Netscape/Mozilla, but not on IE.

Here's the error I get, followed by the code itself:

The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error +and then click the Refresh button, or try again later. Only one top level element is allowed in an XML document. Error proces +sing resource 'http://bkup1/cgi-bin/get-sched.cgi'. Line 1, Position +45 <h1>NBU Backup Schedule Retrieval Tool</h1><p>Choose a backup client f +rom the pulldown menu and push 'get my schedule' to retrieve all acti +ve backup schedules for your chosen server</p><hr /><?xml version="1. +0" encoding="utf-8"?> --------------------------------------------^

The Code

#!/opt/openv/perl/bin/perl -w use strict; use NBUX; use CGI; use CGI::Carp qw/fatalsToBrowser/; my %data; my $sid; my $day; my @clients; my %bpclients = bpclclients(); foreach (sort keys %bpclients) { push @clients, $_; } my $query = new CGI; print $query->header, $query->h1("NBU Backup Schedule Retrieval Tool"), $query->p( 'Choose a backup client from the pulldown menu and pus +h \'get my schedule\' to retrieve all active backup schedules for you +r chosen server' ), $query->hr, $query->start_html( {-bgcolor=>'#CCFFCC'},'NBU Sch +edule Getter'), $query->startform, $query->popup_menu( -name => 'backup client', -values => [@clients], -default => '' ), $query->submit('Action', 'get my schedule'), $query->endform; get_schedule($query->param('backup client')); print $query->end_html; sub get_schedule { my ($client) = @_; my $cmd = "/opt/openv/netbackup/bin/admincmd/bppllist -byclient $c +lient -U"; open CMD, " $cmd |" or die "Cannot run $cmd: $@\n"; while (<CMD>) { next if (/Default/); if (/Policy Name:(\s+)(.*?)$/) { $sid = "$2"; next; } next unless (/(\s+)Daily Windows\:/ .. /(\s+)Schedule\:/); if (/(^\s+)(.*?day)/) { next if (/24|Week/); $day = $_; chomp $day; push @{$data{$sid}}, $day; } } foreach my $key (sort keys %data) { print $query->br, $query->b("$key starts between"); foreach (@{$data{$key}}) { print $query->pre("$_"),; } print "======================================================= +====="; } }

In reply to CGI.pm, XML and Internet Explorer by blink

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.