Hi, you assign to the variable each time through the loop, so it only ever holds one key. Just pass the value if it exists:
for my $found_key ( sort keys %hash1 ) { if ( exists $hash2{ $found_key } ) { ntSpacer( $hash2{ $found_key } ); } } sub ntSpacer { my $seq = shift; ... }
Hope this is all you were looking for ... I didn't check the sub (although it seems you are using the undefined value as a spacer)
In reply to Re: Input Hash Values Into Subroutine
by 1nickt
in thread Input Hash Values Into Subroutine
by FIJI42
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |