in reply to Re: Upload a file from home dir
in thread Upload a file from home dir

Well, I'm not entirely sure what you are trying to do. First, you would use the $filehandle rather than FILE when reading from the file. Second, you are trying to read the entire file twice from the same file handle which won't work. If you want to print the entire contents of the file and then possibly print some additional information based on the regular expression, the following code may help (though I haven't tested it):
sub checkFile() { my @file = <$filehandle>; print( "&lt;BR&gt;&lt;BR&gt;@file&lt;BR&gt;&lt;BR&gt;" ); foreach my $line ( @file ) { chomp( $line ); if( $line =~ /([^ACGTacgt])/ ) { next; } else { my @cols = split( /\s/, $line ); print( "@cols" ); } } }