From 85d4bad1e238a5e902cf390f023744c8e3dc1181 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Jul 2013 17:39:51 -0400 Subject: hack around this for now --- Lexical.xs | 5 +++++ lib/Exporter/Lexical.pm | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Lexical.xs b/Lexical.xs index 1ae3923..868c520 100644 --- a/Lexical.xs +++ b/Lexical.xs @@ -24,3 +24,8 @@ lexical_import(SV *name, CV *cv) SvREFCNT_dec(PL_curpad[off]); PL_curpad[off] = SvREFCNT_inc(cv); LEAVE; + +void +_lex_stuff(const char *str) + CODE: + lex_stuff_pv(str, 0); diff --git a/lib/Exporter/Lexical.pm b/lib/Exporter/Lexical.pm index d7f0ee3..8eaf1a2 100644 --- a/lib/Exporter/Lexical.pm +++ b/lib/Exporter/Lexical.pm @@ -29,6 +29,12 @@ sub import { for my $export (keys %exports) { lexical_import($export, $exports{$export}); } + + # XXX there is a bug with lexical_import where the pad entry sequence + # numbers are incorrect when used with 'use', so the first statement + # after the 'use' statement doesn't see the lexical. hack around this + # for now by injecting a dummy statement right after the 'use'. + _lex_stuff(";1;"); }; { -- cgit v1.2.3