I would check that whatever text is output (for the XML declaration) actually appears on the first line. It's quite possible you have an extraneous newline before this declaration (which may not be immediately obvious from a brief, visual inspection).

For your string, I'd suggest using single-quoting (q), rather than double-quoting (qq), and eliminate all the backslashes:

q{<?xml version="1.0" encoding="UTF-8"?>}

You can still embed newlines in a single-quoted string:

my $three_lines = q{Line 1 Line 2 Line 3};

Here's a real-life example taken from code I use daily:

q{<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet ...

I have no idea what Interwoven TeamSite is - if important to your question, please provide an appropriate link. If you have follow-up questions, please include all relevant code, input and output: paraphrased messages and prosaic code descriptions are far less useful.

-- Ken


In reply to Re: printing xml declaration by kcott
in thread printing xml declaration by manishrathi

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.