Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 115983
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: mischa.schwieger [...] adestra.com
Cc:
AdminCc:

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



Subject: try tiny / DateTime
Date: Fri, 8 Jul 2016 16:57:16 +0100
To: <bug-DateTime [...] rt.cpan.org>
From: mischa.schwieger <mischa.schwieger [...] adestra.com>
Hello, When using DateTime, but forgetting to use Try::Tiny unexpected behavior occurs when using a try{}catch{}; block. I am expecting a 'Can't call method "catch" without a package or object reference at line ...' error ( because 'use Try::Tiny;' is missing ), but getting a 'Not a subroutine reference at /usr/share/perl5/Try/Tiny.pm line 135.' instead. This is quite confusing. I have attached a test script to describe the issue. Kind Regards, Mischa Schwieger -- Mischa Schwieger Perl Developer Adestra Ltd http://www.adestra.com Tel: + 44 (0) 1865 255<ext> Main Tel: +44 (0) 1865 242425 Fax: +44 (0) 1865 255241 Adestra Ltd, Holywell House, Osney Mead, Oxford, OX2 0EA, Registered in England, Company No. 05267378

Message body is not shown because sender requested not to inline it.

DateTime can make this error nicer by using namespace::autoclean or namespace::clean -- currently there is a 'catch' method existing in the DateTime namespace because it was imported from Try::Tiny and then not cleaned after the compilation cycle completed. More insight can be had by dropping in [Test::CleanNamespaces] to the dist.ini for this distribution.