Since you did not post any code on your question, I have to assume your code has some problem. I did the following:

#!/usr/bin/perl; use LWP; use strict; use warnings; my $ua = new LWP::UserAgent; my $r = $ua->get("http://www.perlmonks.org/index.pl?node_id=231795"); if ($r->is_success) { if ($r->content =~ m/^\s+\S/m) { print "I saw some trailing spaces...\n"; } else { print "Oppsie! I did not see any trailing spaces...\n"; } } else { die "Failed miserably\n"; }

... and guess what:

bash-2.05a$ perl lwp
I saw some trailing spaces...
bash-2.05a$ perl -MLWP -e 'print $LWP::VERSION, "\n";'
5.65
bash-2.05a$ 

As you see, in my machine / perl / LWP I obtain trailing spaces alright. So please go ahead and post your code so that we can take a deeper look at what's wrong.

Best regards

-lem, but some call me fokat


In reply to Re: LWP not returning leading spaces in web page by fokat
in thread LWP not returning leading spaces in web page by aspen

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.