in reply to follow-up
in thread Reference to hash tied with Tie::IxHash doesn't remember insertion order

Or just pass in a hash reference for the function to tie:

#!/usr/bin/perl -w use strict; fooFunc( \my %hash ); print "Compare this order to insertion order of fooFunc:\n\n"; foreach (keys %hash) { print $hash{$_}."\n"; } print "\n"; sub fooFunc { my $h= shift; use Tie::IxHash; tie %$h, "Tie::IxHash"; $h->{'donald'} = 'duck'; $h->{'calvin'} = 'human'; $h->{'hobbes'} = 'tiger'; $h->{'mickey'} = 'mouse'; $h->{'zorak'} = 'bug'; }

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Reference to hash tied with Tie::IxHash doesn't remember insertion order
  • Download Code