Hi, thanks for posting your code.

Here is a version that appears to do what you want. Note the following things:

#!/usr/bin/perl use strict; use warnings; use feature 'say'; print "The lower the score the more stable the structure.", "\n", "Please set a limiting value e.g. -3: ", "\n"; chomp( my $value = <STDIN> ); chomp( my @input = <DATA> ); my @trash; my @treasure; for ( @input ){ if ( /^>+/ ) { say "$_ matches '/^>+/'"; push @treasure, $_; } elsif ( /^None/ ) { say "$_ matches '/^None/'"; push @trash, $_; } elsif( /(^[\d\.-]{4})/ ) { say "$_ matches '/(^[\d\.-]{4})/'"; if ( $1 <= $value ) { say "$1 is <= $value"; push @treasure, $_; } else { say "$1 is > $value"; push @trash, $_; } } else { say "$_ doesn't match anything!"; push @trash, $_; } } say 'Treasure:'; foreach my $stuff ( @treasure ) { say $stuff; } __END__ hsa_circ_0067224|chr3:128345575-128345675-|NM_002950|RPN1 FORWARD -4.4.. 6 .. 17 xxxxxxxxxxGTGAC CAGT ATGC ACTG AAGATGAGGTTTGTG -0.9.. 5 .. 18 xxxxxxxxxxxGTGA CCAGT ATGC ACTGA AGATGAGGTTTGTGG None.. 1 .. 20 xxxxxxxxxxxxxxx GTGACCAGTATGCACTGAAG ATGAGGTTTGTGGAC

Hope this helps!


The way forward always starts with a minimal test.

In reply to Re^3: Easiest way to filter a file based on user input by 1nickt
in thread Easiest way to filter a file based on user input by Peter Keystrokes

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.