in reply to Base sequence length in fasta format file

Hi, hopefully you are actually indenting your work and that it got unindented by not using code tags.
#! /usr/local/bin/perl -w use strict; open (INPUT, $ARGV[0]) or die "unable to open file";
This is precisely what the perl idiom while (<>){} is for
my $sequence; my $count =0; my $base = ("A"|"C"|"G"|"T");
This probably doesnt do what you want. $base ends up being the binary or of the string A C G and T. Which happens to be "W". :-)
my @array; my $ideal = 250; while (<INPUT>) {
As i said before the while loop can be rewritten much cleaner. Also you are reading in a line at a time because you havent messed with $/
$sequence = $_;
No need to save $_ unless intend to do something that will smash it. Which afact you arent.
@array = (); @array = split (/\n/, $sequence);
You read in a line, and then you split by \n. That wont help as there will only be 1 (or 0) but not more. So everything from there isnt going to go well. :-)

Maybe this does what you want, or least points you in the right direction?

while (<>) { chomp; # lose potential newlines at the end. (only needed for portab +ility) print $_,"\n" if length $_ > 250; # print out any sequence longer t +han 250chars }
One of the cool things about the while (<>) idiom is that it will allow you to do this:
# find every line over 250 chars from three different files, print the +m to STDOUT over_250 file.1 file.2 file.3 # find lines over 250 chars from STDIN over_250 <file.1

Yves / DeMerphq
Writing a good benchmark isnt as easy as it might look.