1 package PPI::Statement::Scheduled;
7 PPI::Statement::Scheduled - A scheduled code block
11 PPI::Statement::Scheduled
12 isa PPI::Statement::Sub
19 A scheduled code block is one that is intended to be run at a specific
20 time during the loading process.
22 There are five types of scheduled block:
25 # Executes as soon as this block is fully defined
30 # Executes after overall compile-phase in reverse order
35 # Executes after compile-phase of individual module in reverse order
40 # Executes just before run-time
45 # Executes as late as possible in reverse order
49 Technically these scheduled blocks are actually subroutines, and in fact
50 may have 'sub' in front of them.
57 use PPI::Statement::Sub ();
59 use vars qw{$VERSION @ISA};
62 @ISA = 'PPI::Statement::Sub';
65 sub __LEXER__normal { '' }
68 my $child = $_[0]->schild(-1);
72 $child->isa('PPI::Structure::Block')
82 The C<type> method returns the type of scheduled block, which should always be
83 one of C<'BEGIN'>, C<'CHECK'>, C<'UNITCHECK'>, C<'INIT'> or C<'END'>.
89 my @children = $self->schildren or return undef;
90 $children[0]->content eq 'sub'
91 ? $children[1]->content
92 : $children[0]->content;
95 # This is actually the same as Sub->name
106 - Write unit tests for this package
110 See the L<support section|PPI/SUPPORT> in the main module.
114 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
118 Copyright 2001 - 2009 Adam Kennedy.
120 This program is free software; you can redistribute
121 it and/or modify it under the same terms as Perl itself.
123 The full text of the license can be found in the
124 LICENSE file included with this module.