Skip Menu |

This queue is for tickets about the Parse-Nibbler CPAN distribution.

Report information
The Basics
Id: 301
Status: new
Priority: 0/
Queue: Parse-Nibbler

People
Owner: Nobody in particular
Requestors: cburton [...] kpmg.com.au
Cc:
AdminCc:

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



Subject: Patch for Profiler.pm
Hi there, please find attached a patch for Profiler.pm, which is part of Parse-Nibbler-1.10.tar.gz. This is my first submitted patch, and I made it with diff -ru <original> <fixed>. I hope this is cool. It fixes an issue in Profiler.pm where the code being instrumented under Profiler forces subroutines to return scalars. This patch changes Profiler so that profiled subroutines can return arrays. Dist : Parse-Nibbler-1.10.tar.gz PERL: 5.6 OS : Linux RedHat 7.1 Code that shows the bug use Profiler; my @results = &foo(45); print "Results are ",Dumper(\@results),"\n"; sub foo { my @stuff = (1,2,3,4); print "Wantarray is ",wantarray,"\n"; return @stuff; } Should give "Wantarray 1", and does if "use Profiler;" is removed. Kind regards and thankyou for this excellent resource Craig Burton Daniel Burton The Online Assessment Company theoac.com
--- Profiler.pm Fri Feb 22 16:59:50 2002 +++ Profiler_new.pm Fri Feb 22 16:59:07 2002 @@ -278,14 +278,16 @@ { __pre_code ( $name ); - my $ret_val; - eval{ $ret_val = &$coderef; }; + my @ret_val; + eval{ @ret_val = &$coderef; }; my $eval_error = $@; __post_code ( $name ); die ($eval_error) if ($eval_error); - return $ret_val; + return @ret_val if wantarray; + return $ret_val[0]; + }; my $install_string = '*'.$name.' = \&$instrumented_ref; ' ;
Date: 22 Feb 2002 07:07:06 -0800
To: bug-Parse-Nibbler [...] rt.cpan.org
From: email [...] greglondon.com
Subject: Re: [cpan #301] Patch for Profiler.pm
Thanks for the bug report. your patch didn't get attached, but with your testcase, I already see the problem. I'll fix it tonight. Thanks again, Greg
From: "Burton, Craig" <cburton [...] kpmg.com.au>
To: "'bug-Parse-Nibbler [...] rt.cpan.org'" <bug-Parse-Nibbler [...] rt.cpan.org>
Subject: RE: [cpan #301] Patch for Profiler.pm
Date: Mon, 25 Feb 2002 10:35:04 +1100
Hi Greg, I might need to let Jarko know that the bug reporting thing is not attaching patches... Thanks for this great utility. DProf is impossible to use with apache, mod_perl and other things we have rigged up over here and it wants to profile all use'd code as well. I fixed your __instrument subroutine by making $retval into @retval and then returning @retval or $retval[0] depending on wantarray. Cheers, craig. Show quoted text
-----Original Message----- From: email@greglondon.com via RT [mailto:bug-Parse-Nibbler@rt.cpan.org] Sent: Saturday, February 23, 2002 2:07 AM To: cburton@kpmg.com.au Subject: Re: [cpan #301] Patch for Profiler.pm Thanks for the bug report. your patch didn't get attached, but with your testcase, I already see the problem. I'll fix it tonight. Thanks again, Greg ********************************************************************** This email is intended only for the use of the individual or entity named above and may contain information that is confidential and privileged. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this Email is strictly prohibited. When addressed to our clients, any opinions or advice contained in this Email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. If you have received this Email in error, please notify us immediately by return email or telephone +61 2 93357000 and destroy the original message. Thank You. **********************************************************************M
Date: 24 Feb 2002 17:55:06 -0800
To: bug-Parse-Nibbler [...] rt.cpan.org
From: email [...] greglondon.com
Subject: RE: [cpan #301] Patch for Profiler.pm
Craig, I took your test case and used it to fix my profiler code. I've uploaded the profiler as it's own module on CPAN. you no longer have to download Parse::Nibbler to get it. it's called AutoNibbler.pm Hope this fixes it for you. lemme know if you have any other problems. btw, what is the "bug reporting thing" of which you mention? some feature on CPAN, I assume. Greg On Sun, 24 February 2002, cburton @ kpmg . com . au via RT wrote: Show quoted text
> > > > Hi Greg, I might need to let Jarko know that the bug reporting thing is not > attaching patches... > > Thanks for this great utility. DProf is impossible to use with apache, > mod_perl and other things we have rigged up over here and it wants to > profile all use'd code as well. > > I fixed your __instrument subroutine by making $retval into @retval and then > returning @retval or $retval[0] depending on wantarray. > > Cheers, craig. > > -----Original Message----- > From: email@greglondon.com via RT [mailto:bug-Parse-Nibbler@rt.cpan.org] > Sent: Saturday, February 23, 2002 2:07 AM > To: cburton@kpmg.com.au > Subject: Re: [cpan #301] Patch for Profiler.pm > > > > > Thanks for the bug report. > your patch didn't get attached, > but with your testcase, I already > see the problem. I'll fix it > tonight. > > Thanks again, > Greg > > > > > ********************************************************************** > This email is intended only for the use of the individual or entity > named above and may contain information that is confidential and > privileged. If you are not the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > Email is strictly prohibited. When addressed to our clients, any > opinions or advice contained in this Email are subject to the > terms and conditions expressed in the governing KPMG client > engagement letter. If you have received this Email in error, please > notify us immediately by return email or telephone +61 2 93357000 > and destroy the original message. Thank You. > **********************************************************************M
Date: 24 Feb 2002 17:57:24 -0800
To: bug-Parse-Nibbler [...] rt.cpan.org
From: email [...] greglondon.com
Subject: RE: [cpan #301] Patch for Profiler.pm
On Sun, 24 February 2002, cburton @ kpmg . com . au via RT wrote: Show quoted text
> Hi Greg, I might need to let Jarko know that the bug reporting thing is not > attaching patches...
sorry, forgot to mention this. Yes, let Jarko know that attachments are getting stripped out. it might be the intended action, but the fact that it did so without letting you know is a bad thing. Greg