Skip Menu |
 

This queue is for tickets about the B-Hooks-EndOfScope CPAN distribution.

Report information
The Basics
Id: 106248
Status: resolved
Priority: 0/
Queue: B-Hooks-EndOfScope

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

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



Subject: Its not working for me
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-5284-1438698541-151.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 527
Download (untitled) / with headers
text/plain 527b
This module isn't working for me. Is there something I'm not understanding. I'm on Ubuntu and using perlbrew with perl v5.16.3 and B::Hooks::EndOfScope v0.15. I've also tried using B::Hooks::EndOfScope::PP and B::Hooks::EndOfScope::XS but that doesn't help. $ cat a #!/usr/bin/env perl use strict; use warnings; use B::Hooks::EndOfScope; my $a = yo(); print "$a\n"; sub yo { print "1\n"; on_scope_end { what() }; print "2\n"; return '4'; } sub what { print "3\n"; } $ perl a 1 2 4 Thanks! - Kablamo
MIME-Version: 1.0
X-Spam-Status: No, score=-7.079 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, FROM_OUR_RT=-4, RP_MATCHES_RCVD=-1.289, T_DKIM_INVALID=0.01] autolearn=ham
In-Reply-To: <rt-4.0.18-5284-1438698542-1680.106248-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-106248 [...] rt.cpan.org> <rt-4.0.18-5284-1438698542-1680.106248-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
content-type: text/plain; charset="utf-8"
Message-ID: <513E7518-724C-48AA-A430-9E08BDE1F5CB [...] tozt.net>
X-RT-Original-Encoding: utf-8
X-Spam-Score: -7.079
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=softfail (invalid, public key: does not support hash algorithm 'sha256') header.i= [...] tozt.net
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 24A80240485 for <cpan-bug+B-Hooks-EndOfScope [...] hipster.bestpractical.com>; Tue, 4 Aug 2015 10:44:36 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i40P-FuIoeaM for <cpan-bug+B-Hooks-EndOfScope [...] hipster.bestpractical.com>; Tue, 4 Aug 2015 10:44:34 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 6BF2524021F for <bug-B-Hooks-EndOfScope [...] rt.cpan.org>; Tue, 4 Aug 2015 10:44:34 -0400 (EDT)
Received: (qmail 1043 invoked by alias); 4 Aug 2015 14:44:33 -0000
Received: from tozt.net (HELO mail.tozt.net) (162.216.19.228) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 04 Aug 2015 07:44:29 -0700
Received: from [10.0.1.19] (c-24-61-175-161.hsd1.ma.comcast.net [24.61.175.161]) by mail.tozt.net (Postfix) with ESMTPSA id 09116A110 for <bug-B-Hooks-EndOfScope [...] rt.cpan.org>; Tue, 4 Aug 2015 10:44:22 -0400 (EDT)
Delivered-To: cpan-bug+B-Hooks-EndOfScope [...] hipster.bestpractical.com
User-Agent: K-9 Mail for Android
Subject: Re: [rt.cpan.org #106248] Its not working for me
Return-Path: <doy [...] tozt.net>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tozt.net; s=mail; t=1438699463; bh=cp28OnrIpmkIsBILGR15AfeQYOJXCnl2VrNkryG11sM=; h=In-Reply-To:References:Subject:From:Date:To; b=lX3X9XsWcdM9By9F6/msfPdC8cF0aIaBxtOiQlZHsFPej4FdqwQ9Lpyk0l3qCun2A kZJbtUi/GWWCIJ/3DtXV2pexOdBuXkGHGlkeYTqV9MyXzf80Z2YAChxsctZ4V+/QJ9 1Z6Lo9l0bPbtIFjKSI2ycRMMVYW6E9eqq59YF3hQ=
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+B-Hooks-EndOfScope [...] hipster.bestpractical.com
X-RT-Mail-Extension: b-hooks-endofscope
Date: Tue, 04 Aug 2015 10:44:21 -0400
X-Spam-Level:
To: bug-B-Hooks-EndOfScope [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: Jesse Luehrs <doy [...] tozt.net>
RT-Message-ID: <rt-4.0.18-4237-1438699476-561.106248-0-0 [...] rt.cpan.org>
Content-Length: 272
Download (untitled) / with headers
text/plain 272b
Yes - B::Hooks::EndOfScope is for running things at the end of compile time scope, not runtime. If you wrap the on_scope_end call in a BEGIN block, it will fire the next time the compiler reaches a }. I think the module you're actually looking for is Scope::Guard. -doy
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-4237-1438699476-561.106248-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-106248 [...] rt.cpan.org> <rt-4.0.18-5284-1438698542-1680.106248-4-0 [...] rt.cpan.org> <513E7518-724C-48AA-A430-9E08BDE1F5CB [...] tozt.net> <rt-4.0.18-4237-1438699476-561.106248-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-18796-1438789432-1203.106248-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 7
Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.