Sorry for the '.*' I put it in hoping that the whole line would be matched and not truncated. As far as the @current_sentence, I am just pushing words onto the array as I strip them from a data base. In the example I gave 'so' is the first word in the sentence, so I also added a '<s>' to the word I pushed, here is the code:
push @current_sentence, "<s> $current_word ";
Then I push additional words onto the array as I find them with this:
push @current_sentence, "$current_word ";
Finally the last word of a sentence gets pushed like so:
push @current_sentence, "$current_word <\/s>\n";
Another interesting comment, I just tried printing the string outside the if statement and the whole thing printed! But earlier I tried to get around this by having the if statement set a flag and then printing from another if statement that checked the flag... and it still printed truncated. So I still can't print conditionally.

Thanks for all the help so far.

An update: I have looked at the behavior on some other examples and it seem as though the print statement is printing the array element that was originally pushed onto the array, even though I put the array into a single string. What I mean be this is that if the word starts a sentence, the <s> tag is ahead of it, if it is in the middle there are no other tags, and if it was at the end a </s> tag follows it. Baffeling to me!


In reply to Re: Re: Why doesn't the whole line print? by hillard
in thread Why doesn't the whole line print? by hillard

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.