Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Hash of References in an Object

by LanceDeeply (Chaplain)
on May 26, 2005 at 14:36 UTC ( #460708=note: print w/replies, xml ) Need Help??


in reply to Hash of References in an Object

not what you asked for but... you may want to make your instantiation of copy books more flexible. perhaps add a method to Product::Datafile that takes in an array of filter codes
sub createCopybooks { my $self = shift; my @filterCodes = @_; my %copyBooks; foreach my $filterCode ( @filterCodes ) { my $copyBook = Cobol::Copybook->new({filehandle = +> \*DATA, filter => $filterCode} ); my $copyBookName = 'cpy' . $filterCode; $copyBooks{$copyBookName} = $copyBook; } $self->{copybooks} = \%copyBooks; }
then you can easily change how many copybooks you want like so:
$productDatafile->createCopybooks('00', '01', '04', '42', '99');
hth!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://460708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2021-05-13 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (134 votes). Check out past polls.

    Notices?