Skip Menu |

This queue is for tickets about the DBIx-RewriteDSN CPAN distribution.

Report information
The Basics
Id: 62252
Status: resolved
Priority: 0/
Queue: DBIx-RewriteDSN

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

Bug Information
Severity: Normal
Broken in: 0.03
Fixed in: 0.04



Subject: eval block around use statement
The following non-idiom isn't quite doing what you expect: eval { use DBD::SQLite; }; Since 'use' is compile time it happens before the eval is reached and the eval is not protecting the use. So if DBD::SQLite is missing the test will die. If you use 'require' within the eval block, you get what you want. Thanks,
From: cho45 [...] lowreal.net
Thank you. This is fixed at 0.04. On 2010-10月-18 月 23:36:19, ANDK wrote: Show quoted text
> The following non-idiom isn't quite doing what you expect: > > eval { use DBD::SQLite; }; > > Since 'use' is compile time it happens before the eval is reached and > the eval is not protecting the use. So if DBD::SQLite is missing the > test will die. > > If you use 'require' within the eval block, you get what you want. > > Thanks,