Out of the following methods, Foo, which design would you choose?
A method that returns both its return-code and value in a list.
my ($rc, $value) = Foo(@args);
Or, a method that simply returns an undefined value to indicate an error.
my $value = Foo(@args);
die("Damn!") unless ($value);
Or, a method that takes a reference to a variable where the return value must be stored, and returns the status code to indicate an error.
Foo(\$value, @args) or die("Damn!");
Or, a design where Foo returns you the status, and you have to call a separate method to get the result of processing.
Foo(@args) or die("Damn!");
my $value = GetValueFromLastCallToFoo();
Which do you think is the best?