in reply to Hash of References in an Object

You're getting confused with how Data::Dumper displays stuff. All three filehandles are identical, so it's pointing out that if you do something to one fh, you're doing it to the fh referenced in all three.

Personally, given that your keys are "cpy##", I'd use an array of hashes.

$self->{copybooks} = [ Cobol::Copybook->new({filehandle => \*DATA, filter => '00'}), Cobol::Copybook->new({filehandle => \*DATA, filter => '01'}), undef, undef, Cobol::Copybook->new({filehandle => \*DATA, filter => '04'}), ];

  • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
  • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"