Author: tim.bunce
Date: Tue Jan 20 05:03:08 2009
New Revision: 673

Modified:
    trunk/t/test22-strevala.p

Log:
This one was wierd! It seems that the statement
     $code = "sub { 1 }";
     eval($code)->() for (1,2)
only causes one eval as far as NYTProf can see, for perl > 5.8.6.
It's as if the compilation from the first eval is reused.
Changing the $code string to be a sub with side-effects fixed it.
Changing the code like this
     eval($code)->(); eval($code)->();
also fixed it.


Modified: trunk/t/test22-strevala.p
==============================================================================
--- trunk/t/test22-strevala.p   (original)
+++ trunk/t/test22-strevala.p   Tue Jan 20 05:03:08 2009
@@ -1,6 +1,6 @@
  # test merging of anon subs from evals

-my $code = 'sub { 1 }';
+my $code = 'sub { print "sub called\n" }';

  # call once from particular line
  eval($code)->();

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to