Skip Menu |

This queue is for tickets about the Sub-Current CPAN distribution.

Report information
The Basics
Id: 53570
Status: new
Priority: 0/
Queue: Sub-Current

People
Owner: Nobody in particular
Requestors: l.mai [...] web.de
Cc:
AdminCc:

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



Subject: Sub::Current overwrites entire typeglob when importing
Date: Sun, 10 Jan 2010 19:12:15 +0100
To: bug-Sub-Current [...] rt.cpan.org
From: Lukas Mai <l.mai [...] web.de>
Hi, instead of exporting just &ROUTINE (*foo = \&bar), Sub::Current exports the entire typeglob (*foo = *bar), which has two unexpected consequences: - It clobbers the calling package's $ROUTINE, @ROUTINE, etc. - All packages that use Sub::Current suddenly have the same $ROUTINE, @ROUTINE, etc. Here's a demonstration: #!perl our $ROUTINE; BEGIN { $ROUTINE = "ok"; } use Sub::Current; { package Gramentian; use Sub::Current; our $ROUTINE = "not ok"; } print $ROUTINE, "\n"; __END__ I think this is wrong. (At least it's not documented.)