in reply to Replacing substrings within hash values

foreach my $key (sort keys%sequences)
Are I and II Roman numerals? Are they supposed to be in that order (I, II, III, IV etc)? Perl doesn't speak Latin, so it, for example, will sort IX before VI.

Also, consider:

my $str = "abcde"; print substr( $str, 0, 3 );
That prints abc. Just reread the doc of substr.

Replies are listed 'Best First'.
Re^2: Replacing substrings within hash values
by K_Edw (Beadle) on Mar 24, 2016 at 13:50 UTC

    They are indeed roman numerals - they can easily be substituted once i've got a general idea of how the script should work.

    I see that i've misunderstood substr. So it should be:

    substr($value,$F[1]-1,1) = $F[3]

    I think.