... mutiple lines like ACGTGACGTACGTACGTACGTA AGTACGATCACCCCCGTAGACG ACGTAGACATCAGATCGATAGT ...
From looking at your example data, my guess is that you are working with data records composed of multiple lines of data. Also from your example, it seems that each record begins with a '>' character.

If these guesses are acurate, it may be useful to set the input record separator variable $/ (see perlvar) to '>', then read each record with a single statement and then remove all newlines from the record with a substitution.

Note, however, that because the first record of the file begins with a '>', the first record read from the file (any stuff before the first '>') is junk and must be ignored.

E.g. (untested):

$/ = '>'; # throw away first (junk) record defined(<$fh>) or ($! and die "reading: $!"); while (defined(my $record = <$fh>) or ($! and die "reading: $!")) { $record =~ s{ \n }{}xmsg; process($record); }
Update: Since a <$fh> record read reads up to and including the input record separator string specified in $/ (or to the end of the file), there should probably be a chomp in that while loop to remove the extraneous '>' character at the end of each record:
while (defined(my $record = <$fh>) or ($! and die "reading: $!")) { chomp $record; # remove $/ string $record =~ s{ \n }{}xmsg; process($record); }

In reply to Re^3: Debug help by AnomalousMonk
in thread Debug help by ashnator

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.