leocharre has asked for the wisdom of the Perl Monks concerning the following question:
So.. I see this every here and there scattered throughout some subs in my code..
sub resolve_value { my $start_with = another_value() or warn("Could not get another value") and return; # continue.. }
I want to have a function/subroutine that will cause the caller to return something (null in this case), and whatever arguments(s) it may have, are output to STDERR, as warn would.
So the same thing rewritten would be as..
(Setting aside how useless and waste of time these kind of "ideas" are..)sub resolve_value { my $start_with = another_value() or wreturn("Could not get another value"); # continue.. }
It's a little bit weird because such a sub/command/keyword/function would not simply return something or not, but would cause the calling code/sub to return, itself.
|
|---|