in reply to A Better way? (Lots of routines with similar structure)
Without getting into any changes to the style of your code. It seems like you could have generic sub that can do both checking and adding if you pass your name and statement as arguments.
Unless I missed something in your original code this should allow to check and add actors/directors/genre etc.
mr greywolf
sub workItem { my $self = shift; my %args = @_; die "Must supply value for name" unless ($args{name}); die "Must supply value for statement" unless ($args{statement}); my $retval = $self->_execute( handle => 'appfme', statement => [ $args{statement} ], bindvar => [ $args{name} ], output => 1); }
Unless I missed something in your original code this should allow to check and add actors/directors/genre etc.
mr greywolf
In Section
Seekers of Perl Wisdom