in reply to Re^3: Transferring hash keys to array... Need help sorting
in thread Transferring hash keys to array... Need help sorting

I actually have a hash set up already that contains keys= the labels and values= sequence content. I read these keys and values into an array because it was easier to manipulate them (reverse and tr them and insert spaces between characters). Is there a way to just manipulate them straight from a hash reference instead of putting the keys and values into arrays? If so, I can just avoid arrays all together
  • Comment on Re^4: Transferring hash keys to array... Need help sorting

Replies are listed 'Best First'.
Re^5: Transferring hash keys to array... Need help sorting
by Anonymous Monk on Apr 21, 2017 at 19:47 UTC

    Of course you can manipulate the data. For example:

    foreach my $record (values %$HoH) { $record->{label} =~ tr/A-Za-z/N-ZA-Mn-za-m/; }
    Should perform the rot13 cryption on all the label fields. See perlop for =~, tr, etc.

      I'm a little new to Perl (clearly) and this makes things much easier... My use of arrays was pointless. I'm just going to copy and paste all the code manipulating the arrays and operate on the hash. Thanks