in reply to Re^2: Avoid run-time checking
in thread Avoid run-time checking
Refactoring this into two different classes would be creating more duplication of code. since the rest of logic is the same.(handling missing field, and what not..;)
So make 3 classes , they don't have to OO :) MyRecs; MyRecs::Big; MyRecs::Lil;
sub MyRecs::foo { my( $ro, $sham, $bo ) = @_; die "sham must sham " if not $sham =~ /sham/i; ... } sub MyRecs::Lil::foo { MyRecs::foo( unpack "n3A*", ... ); } sub MyRecs::Big::foo { MyRecs::foo( unpack "v3A*", ... ); }
|
|---|