NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
No more expressive than exception objects (Score:1)
I would rate it bad because it is unexpected. It is worth to notice that in the general case your output variables is undefined if the function throws an exception.
If you want to return a value in an exceptionish way I would prefere using an Exception object[0] or in perl:
sub foo {
die { value => 42, Exception => 'Beeep' }
}
my $val;
eval { foo() };
if ($@) {
$val = $@->{value};
}
0) No I don't know if C# allows that. Some other languages seems to do.
Reply to This