in reply to Print Subroutine Problem

Although I can't see an obvious error, I'd suggest two points of attack:

  1. Explicitly print to STDOUT or OUTFILE -- in your code it's implicit
  2. Although it *should* work correctly the way you have it set up, it is not exactly great form to not pass variables declared with 'my' to the subroutines that are supposed to manipulate them.

Here's a stab:

&print_out(\%version, \%slots, \%peer); sub print_out { my ($vers_key, $mod_key, $peer_dev); my ($version_ref, $slots_ref, $peer_ref) = @_; foreach $vers_key (sort keys %{$version_ref}) { foreach $mod_key (sort keys %{$slots_ref}) { my $module = join "", @{$slots_ref->{$mod_key}}; foreach $peer_dev (sort keys %{peer_ref}) { my ($prv, $pub) = @{$peer_ref->{$peer_dev}}; print STDOUT "$peer_dev:\n"; print STDOUT "================\n"; print STDOUT "belongs to AS123\n"; print STDOUT "private peers: $prv\n"; print STDOUT "public peers: $pub\n\n"; print STDOUT "IOS Version: $vers_key\n"; print STDOUT "$module\n"; } } } }