Skip Menu |

This queue is for tickets about the TryCatch CPAN distribution.

Report information
The Basics
Id: 75943
Status: new
Priority: 0/
Queue: TryCatch

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.003000
Fixed in: (no value)



Subject: Silently fails if 'my' variable given in catch
If you say 'catch (my $x)' then the try/catch block silently fails to work. Example program: use 5.014; use TryCatch; try { say 'testing thing that dies'; die 'urk'; say 'called'; } catch (my $x) { say "caught error"; } say 'hello'; I expected this to print testing thing that dies caught error hello but instead it prints urk at wacsl_decompose line 6. ...propagated at wacsl_decompose line 12. testing thing that dies showing that the error has not been caught. I understand that 'catch ($x)' creates a new lexically scoped variable $x - although this is not crystal clear from the documentation. However, if 'catch (my $x)' is given instead, it should do something sensible, such as giving an error message or working the same as 'catch ($x)'.