in reply to Re: Knowing when a code string contains code that will be executed at compile-time/end? (updated)
in thread Knowing when a code string contains code that will be executed at compile-time/end?

Your examples use run time actions to create END blocks.

They should show up when applying B::Deparse

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: Knowing when a code string contains code that will be executed at compile-time/end?

Replies are listed 'Best First'.
Re^3: Knowing when a code string contains code that will be executed at compile-time/end?
by haukex (Archbishop) on Aug 15, 2020 at 09:46 UTC
    They should show up when applying B::Deparse

    Nope, as the OP shows. Plus deparsing requires an eval of the string first.

    use warnings; use strict; use B::Deparse; my $code = q{ print "code\n"; s s s END { print "end\n" } see }; my $coderef = eval qq{ sub { $code } }; my $deparse = B::Deparse->new(); $deparse->ambient_pragmas(strict => 'all', warnings=>'all'); print $deparse->coderef2text($coderef), "\n"; __END__ { print "code\n"; s/ /();/ee; } end