Hello 1nickt,
I was experimenting with Data::Printer as an alternative way.
You can use it for example like:
use Data::Printer; p %hash;
This why you could see the printing part. Hope is more clear now. :)
Update: Sample of code that I was experimenting, see below:
#!/usr/bin/perl use strict; use warnings; use Data::Printer; my %hash = ( ';LCBO - Prolactin precursor - Bovine' => "a sample seque +nce in FASTA format MDSKGSSQKGSRLLLLLVVSNLLLCQGVVSTPVCPNGPGNCQVSLRDLFDRAVMVSHYIHD +LSS EMFNEFDKRYAQGKGFITMALNSCHTSSLPTPEDKEQAQQTHHEVLMSLILGLLRSWNDPL +YHL VTEVRGMKGAPDAILSRAIEIEEENKRLLEGMEMIFGQVIPGAKETEPYPVWSGLPSLQTK +DED ARYSAFYNLLHCLRRDSSKIDTYLKLLNCRIIYNNNC*" ); my $filename = 'output.txt'; open(my $fh, '>', $filename) or die "Could not open file '$filename' $!"; p(%hash, output => $fh); close $fh or warn "Could not open file '$filename' $!"; print "Done\n"; __END__ $ perl test.pl Done $ cat output.txt { ';LCBO - Prolactin precursor - Bovine' "a sample sequence in FAS +TA format MDSKGSSQKGSRLLLLLVVSNLLLCQGVVSTPVCPNGPGNCQVSLRDLFDRAVMVSHYIHD +LSS EMFNEFDKRYAQGKGFITMALNSCHTSSLPTPEDKEQAQQTHHEVLMSLILGLLRSWNDPL +YHL VTEVRGMKGAPDAILSRAIEIEEENKRLLEGMEMIFGQVIPGAKETEPYPVWSGLPSLQTK +DED ARYSAFYNLLHCLRRDSSKIDTYLKLLNCRIIYNNNC*" }
BR / Thanos
In reply to Re^3: Print Output to New File (UPDATED)
by thanos1983
in thread Print Output to New File
by FIJI42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |