Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.