Content deleted Content added
m Dating maintenance tags: {{Deadlink}} |
→Perl 5: Another link: http://mvp.kablamo.org/cpan/exceptions/ —DIV |
||
Line 802:
The forms shown above can sometimes fail if the global variable {{Perl2|$@}} is changed between when the exception is thrown and when it is checked in the {{Perl2|if ($@)}} statement. This can happen in multi-threaded environments, or even in single-threaded environments when other code (typically
called in the destruction of some object) resets the global variable before the checking code.
The following example shows a way to avoid this problem (see [http://www.perlfoundation.org/perl5/index.cgi?exception_handling]{{deadlink|date=October 2020}} or [https://stackoverflow.com/a/10343025]; ''cf''. [http://mvp.kablamo.org/cpan/exceptions/]). But at the cost of not being able to use return values:
<syntaxhighlight lang="perl">
|