|
|
| Just another Perl shrine | |
| PerlMonks |
Re: How can I get the results in a text file from counting in a string?by Kenosis (Deacon) |
| on Aug 07, 2012 at 19:16 UTC ( #986061=note: print w/ replies, xml ) | Need Help?? |
|
kennethk has provided great targeted script advice. Here's another coding option:
Output to file:
This option uses the e modifier in the substitution to execute the embedded code, which holds position/letter (key/value) pairs in a hash. The printing part numerically sorts the keys, sending the output to Results.txt. Hope this helps! Update: by modifying the script a little, it can generate your output:
Output to file:
Here, Sort::Naturally is used to sort the keys which have mixed content, e.g., A=1.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||