Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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 ( [id://11120773]=note: print w/replies, xml ) Need Help??


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

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
  • Comment on Re^3: Knowing when a code string contains code that will be executed at compile-time/end?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120773]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found