Acme-AllThePerlIsAStage
view release on metacpan or search on metacpan
lib/Acme/AllThePerlIsAStage.pm view on Meta::CPAN
$our_set_at_begin = $$;
_say_stage("BEGIN 1");
}
UNITCHECK {
$my_set_at_unitcheck = $$;
$our_set_at_unitcheck = $$;
_say_stage("UNITCHECK 1");
}
CHECK {
$my_set_at_check = $$;
$our_set_at_check = $$;
_say_stage("CHECK 1");
}
INIT {
$my_set_at_init = $$;
$our_set_at_init = $$;
$my_set_at_init_and_run = $$;
$our_set_at_init_and_run = $$;
_say_stage("INIT 1");
}
END {
$my_set_at_end = $$;
$our_set_at_end = $$;
_say_stage("END 1");
}
END {
_say_stage("END 2");
}
INIT {
_say_stage("INIT 2");
}
CHECK {
_say_stage("CHECK 2");
}
UNITCHECK {
_say_stage("UNITCHECK 2");
}
BEGIN {
_say_stage("BEGIN 2");
}
if ( ${^GLOBAL_PHASE} eq 'RUN' ) {
_say_stage("IF-RUN 2");
}
_say_stage("Global Scope 2");
1;
__END__
=encoding utf-8
=head1 NAME
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
( run in 2.604 seconds using v1.01-cache-2.11-cpan-e93a5daba3e )