in reply to OO design: returning string and/or special value
Hi, if you don't want to require the caller of your method to provide params (?!) you should just return all the data and let the caller consume the parts that are interesting. Return a hashref if the caller is another Perl routine, or a JSON obj if there's data interchange. Steer clear of wantarray and conditional/inconsistent return values in general.
Hope this helps.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: OO design: returning string and/or special value
by wanna_code_perl (Friar) on Oct 07, 2019 at 22:14 UTC | |
by 1nickt (Canon) on Oct 08, 2019 at 00:13 UTC |