#!/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 = ); chomp( my @input = ); 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