in reply to Re^19: how to read input from a file, one section at a time?
in thread how to read input from a file, one section at a time?

printf "%d duplicate records written\n",$name,$para,$out_filename;

see printf and sprintf. You need to put %s in the print format for strings, %d for integers

while ( my $para = <$PROTFILE> ) { # Remove fasta header line if ( $para =~ s/^>(.*)//m ){ $name = $1; }; # Remove comment line(s) $para =~ s/^\s*#.*//mg; # Trim trailing white space $para =~ s/\s+$//; # next FASTA_RECORD if $fasta_seen{ $para }++; if ( $fasta_seen{ $para }++ ){ printf "duplicate record %s %s \nwritten to %s\n",$name,$para,$out +_filename; print $OUTFILE '>'.$name.$para."\n\n"; } }
poj

Replies are listed 'Best First'.
Re^21: how to read input from a file, one section at a time?
by davi54 (Sexton) on Apr 03, 2019 at 17:24 UTC
    Ohh.. okay.. still learning.. Thanks.. :)