Acme-AllThePerlIsAStage

 view release on metacpan or  search on metacpan

lib/Acme/AllThePerlIsAStage.pm  view on Meta::CPAN

Acme::AllThePerlIsAStage - Grok perl stages for scripts and modules under use and require–uncompiled and compiled

=head1 VERSION

This document describes Acme::AllThePerlIsAStage version 0.01

=head1 SYNOPSIS

Compare output points to see what-happens-when in order to understand why and decide on what to do:

    perl -e 'use Acme::AllThePerlIsAStage;'
    perl -e 'use Acme::AllThePerlIsAStage;'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use
    ./tmp/use
    ./tmp/use
    perl -e 'use Acme::AllThePerlIsAStage ();'
    perl -e 'use Acme::AllThePerlIsAStage ();'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use_no_import
    ./tmp/use_no_import
    ./tmp/use_no_import
    perl -e 'require Acme::AllThePerlIsAStage;'
    perl -e 'require Acme::AllThePerlIsAStage;'
    perlcc -e 'require Acme::AllThePerlIsAStage;' -o tmp/req
    ./tmp/req
    ./tmp/req

=head1 DESCRIPTION

Sometimes the stages involved in perl’s execution can be hard to grasp. It gets even hairier when you start compiling your code.

When trying to explain and then demonstrate what was happening I found myself writing scripts and modules to output what perl is doing where in order to find out if my understanding lined up with reality. Then to see how reality held up once compiled...

Finally, making a set up every few months got old and I thought I’d put it all on CPAN for the masses to enjoy/ignore.

=head1 TL;DR

Too Long; Didn’t Run

TODO v0.02 – fill me out (sorry, ran our of time)

=head2 stage info

TODO v0.02 – fill me out (sorry, ran our of time)

=head2 subroutine info

TODO v0.02 – fill me out (sorry, ran our of time)

=head2 our $vars

TODO v0.02 – fill me out (sorry, ran our of time)

=head2 my $vars

TODO v0.02 – fill me out (sorry, ran our of time)

=head1 INTERFACE

Just use or require the module. It outputs info you can use to visualize and study in order to grok L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">.

If the environment variable 'AllThePerlIsAStage_verbose' is true it outputs info on various symbols at each point in the process.

=head2 use()/require() compiled/uncompiled

    perl -e 'use Acme::AllThePerlIsAStage;'
    perl -e 'use Acme::AllThePerlIsAStage;'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use
    ./tmp/use
    ./tmp/use
    perl -e 'use Acme::AllThePerlIsAStage ();'
    perl -e 'use Acme::AllThePerlIsAStage ();'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use_no_import
    ./tmp/use_no_import
    ./tmp/use_no_import
    perl -e 'require Acme::AllThePerlIsAStage;'
    perl -e 'require Acme::AllThePerlIsAStage;'
    perlcc -e 'require Acme::AllThePerlIsAStage;' -o tmp/req
    ./tmp/req
    ./tmp/req

more verbose:

    AllThePerlIsAStage_verbose=1 perl -e 'use Acme::AllThePerlIsAStage;'
    AllThePerlIsAStage_verbose=1 perl -e 'use Acme::AllThePerlIsAStage;'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use
    AllThePerlIsAStage_verbose=1 ./tmp/use
    AllThePerlIsAStage_verbose=1 ./tmp/use
    AllThePerlIsAStage_verbose=1 perl -e 'use Acme::AllThePerlIsAStage ();'
    AllThePerlIsAStage_verbose=1 perl -e 'use Acme::AllThePerlIsAStage ();'
    perlcc -e 'use Acme::AllThePerlIsAStage;' -o tmp/use_no_import
    AllThePerlIsAStage_verbose=1 ./tmp/use_no_import
    AllThePerlIsAStage_verbose=1 ./tmp/use_no_import
    AllThePerlIsAStage_verbose=1 perl -e 'require Acme::AllThePerlIsAStage;'
    AllThePerlIsAStage_verbose=1 perl -e 'require Acme::AllThePerlIsAStage;'
    perlcc -e 'require Acme::AllThePerlIsAStage;' -o tmp/req
    AllThePerlIsAStage_verbose=1 ./tmp/req
    AllThePerlIsAStage_verbose=1 ./tmp/req

=head2 from a script point of view

There are script's in the module’s share/ dir (not installed on your system but they are there if you want them).

To see what it looks like when use()d from a script, compare:

    ./and_one_man_in_his_time_plays_many_parts.pl
    ./and_one_man_in_his_time_plays_many_parts.pl
    perlcc ./and_one_man_in_his_time_plays_many_parts.pl -o and_one_man_in_his_time_plays_many_parts
    ./and_one_man_in_his_time_plays_many_parts
    ./and_one_man_in_his_time_plays_many_parts

more verbose:

    AllThePerlIsAStage_verbose=1 ./and_one_man_in_his_time_plays_many_parts.pl
    AllThePerlIsAStage_verbose=1 ./and_one_man_in_his_time_plays_many_parts.pl
    AllThePerlIsAStage_verbose=1 perlcc ./and_one_man_in_his_time_plays_many_parts.pl -o and_one_man_in_his_time_plays_many_parts
    AllThePerlIsAStage_verbose=1 ./and_one_man_in_his_time_plays_many_parts
    AllThePerlIsAStage_verbose=1 ./and_one_man_in_his_time_plays_many_parts

To see what it looks like when require()d from a script, compare:

    ./they_have_their_exits_and_their_entrances.pl



( run in 1.652 second using v1.01-cache-2.11-cpan-aadc1410aed )