Skip Menu |
 

This queue is for tickets about the TryCatch CPAN distribution.

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

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

Bug Information
Severity: (no value)
Broken in: 1.002000
Fixed in: (no value)



Subject: Can't "last" from within a try { ... }
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 843
Download (untitled) / with headers
text/plain 843b
Test suite: #!/usr/bin/perl use strict; use warnings; use Test::More tests => 2; use Test::NoWarnings; use TryCatch; my $count = 0; for (1..2) { $count++; try { last; } catch ($e) { print "Error"; } } is($count, 1, "only ran once"); Actual result: 1..2 not ok 1 - only ran once # Failed test 'only ran once' # at try.pl line 21. # got: '2' # expected: '1' not ok 2 - no warnings # Failed test 'no warnings' # at /Library/Perl/5.10.0/Test/NoWarnings.pm line 45. # There were 2 warning(s) # Previous test 0 '' # Exiting eval via last at try.pl line 15. # at try.pl line 15 # eval {...} called at try.pl line 14 # # ---------- # Previous test 0 '' # Exiting eval via last at try.pl line 15. # at try.pl line 15 # eval {...} called at try.pl line 14 # # Looks like you failed 2 tests of 2.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.