]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Fasta.pm
renamed patternmatcher to dynamic
[biopieces.git] / code_perl / Maasha / Fasta.pm
index 4e28f8733e488781c538ef5039ff831717f36d36..339885bdf4d304c917704ed8cf3c58bb35240f26 100644 (file)
@@ -30,6 +30,7 @@ package Maasha::Fasta;
 
 use warnings;
 use strict;
+use Exporter;
 use Data::Dumper;
 use Maasha::Common;
 use Maasha::Filesys;
@@ -95,7 +96,7 @@ sub put_entry
 {
     # Martin A. Hansen, January 2007.
 
-    # Writes FASTA entries to STDOUT or file.
+    # Writes a FASTA entry to a file handle.
 
     my ( $entry,     # a FASTA entries
          $fh,        # file handle to output file - OPTIONAL
@@ -119,6 +120,29 @@ sub put_entry
 }
 
 
+sub put_entries
+{
+    # Martin A. Hansen, September 2009
+
+    # Write FASTA entries to a file.
+
+    my ( $entries,   # list of FASTA entries
+         $file,      # output file
+         $wrap,      # line width  -  OPTIONAL
+       ) = @_;
+
+    # Returns nothing
+
+    my ( $fh );
+
+    $fh = Maasha::Filesys::file_write_open( $file );
+
+    map { put_entry( $_, $fh, $wrap ) } @{ $entries };
+
+    close $fh;
+}
+
+
 sub wrap
 {
     # Martin A. Hansen, June 2007