Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Hash of References in an Object

by LanceDeeply (Chaplain)
on May 26, 2005 at 14:36 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found