Skip Menu |

This queue is for tickets about the Ogg-Vorbis-Header CPAN distribution.

Report information
The Basics
Id: 23489
Status: resolved
Priority: 0/
Queue: Ogg-Vorbis-Header

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

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



Subject: Can't lazy-load the module at run-time
I'm trying to lazy-load various modules only if I need them. I only need OggVorbis support, for example, when operating on an actual .ogg file. This reduces startup time and means that users don't need OggVorbis code present if they're not operating on such files. I can do this, and it works: $ perl use Ogg::Vorbis::Header; Ogg::Vorbis::Header->load( "/dev/null" ); (it just returns undef, as expected). If I try this instead: $ perl eval "use Ogg::Vorbis::Header;"; Ogg::Vorbis::Header->load( "/dev/null" ); Undefined subroutine &Ogg::Vorbis::Header::_new called at /usr/lib/perl5/Ogg/Vorbis/Header.pm line 29. One or more DATA sections were not processed by Inline. I've tried various other variations on this theme - require/import, etc... All of them result in the same error. I suspect it's a problem relating to the use of Inline::C code; the above technique works fine with the Ogg::Vorbis::Header::PurePerl module. For reference: $ perl --version This is perl, v5.8.8 built for i486-linux-gnu-thread-multi $ perl -mInline -e 'print $Inline::VERSION;' 0.44 $ perl -mOgg::Vorbis::Header -e 'print $Ogg::Vorbis::Header::VERSION;' 0.03 Perhaps is there any way to fix this? -- Paul Evans
Subject: Re: [rt.cpan.org #23489] Can't lazy-load the module at run-time
Date: Sun, 19 Nov 2006 15:31:36 -0600
To: Paul Evans via RT <bug-Ogg-Vorbis-Header [...] rt.cpan.org>
From: Dan Pemstein <dan [...] lcws.org>
Hi Paul, This is indeed an issue with Inline::C. Here's a kludgy little workaround: eval "use Ogg::Vorbis::Header"; require Inline; Inline->init; Ogg::Vorbis::Header->load("/dev/null"); It forces Inline::C to read the c code in OVH even when the module is called in a lazy fashion. Hope this helps. cheers, Dan On Sat, Nov 18, 2006 at 06:12:50PM -0500, Paul Evans via RT wrote: Show quoted text
> > Sat Nov 18 18:12:49 2006: Request 23489 was acted upon. > Transaction: Ticket created by PEVANS > Queue: Ogg-Vorbis-Header > Subject: Can't lazy-load the module at run-time > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: leonerd-cpan@leonerd.org.uk > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23489 > > > > I'm trying to lazy-load various modules only if I need them. I only need > OggVorbis support, for example, when operating on an actual .ogg file. > This reduces startup time and means that users don't need OggVorbis code > present if they're not operating on such files. > > I can do this, and it works: > > $ perl > use Ogg::Vorbis::Header; > Ogg::Vorbis::Header->load( "/dev/null" ); > > (it just returns undef, as expected). > > If I try this instead: > > $ perl > eval "use Ogg::Vorbis::Header;"; > Ogg::Vorbis::Header->load( "/dev/null" ); > Undefined subroutine &Ogg::Vorbis::Header::_new called at > /usr/lib/perl5/Ogg/Vorbis/Header.pm line 29. > One or more DATA sections were not processed by Inline. > > I've tried various other variations on this theme - require/import, > etc... All of them result in the same error. > > I suspect it's a problem relating to the use of Inline::C code; the > above technique works fine with the Ogg::Vorbis::Header::PurePerl module. > > For reference: > > $ perl --version > This is perl, v5.8.8 built for i486-linux-gnu-thread-multi > > $ perl -mInline -e 'print $Inline::VERSION;' > 0.44 > > $ perl -mOgg::Vorbis::Header -e 'print $Ogg::Vorbis::Header::VERSION;' > 0.03 > > Perhaps is there any way to fix this? > > -- > > Paul Evans >
-- Daniel Pemstein Email: dan@lcws.org Web: http://www.danpemstein.com PGP: http://www.danpemstein.com/files/pgp.txt
Download (untitled)
application/pgp-signature 191b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #23489] Can't lazy-load the module at run-time
Date: Tue, 21 Nov 2006 22:11:24 +0000
To: bug-Ogg-Vorbis-Header [...] rt.cpan.org
From: Paul LeoNerd Evans <leonerd [...] leonerd.org.uk>
On Mon, 20 Nov 2006 08:55:14 -0500 "Dan Pemstein via RT" <bug-Ogg-Vorbis-Header@rt.cpan.org> wrote: Show quoted text
> This is indeed an issue with Inline::C. Here's a kludgy little > workaround: > > eval "use Ogg::Vorbis::Header"; > require Inline; > Inline->init; > Ogg::Vorbis::Header->load("/dev/null");
Marvelous. That's exactly what's required, that solved the problem. Much thanks. -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

I'm reviewing all of my CPAN RT queues before the service closes down next year. It looks like you do a solution back in 2006, but Dan forgot to close the ticket. So I'm closing it now. Dave...