MidLifeXis has asked for the wisdom of the Perl Monks concerning the following question:
I have a third-party library that uses shell-style return codes (0 == success, anything else == error). An example chunk of code might be:
my $libobj = Third::Party::Library->new(...); my $item = $libobj->NewItem(...); $item->frobinize(...) and die($libobj->GetErrorCode); $item->blatinate(...) and die($libobj->GetErrorCode);
The ... and ... just does not seem very perlish. Are there other patterns that are more compact, perlish, and easy to maintain? It does seem as compact and readable as can be, but the ... and ... just seems wrong.
Any thoughts?
--MidLifeXis
|
|---|