4 package MooseX::Declare::Util;
6 use Sub::Exporter -setup => {
16 sub outer_stack_push {
17 my ($file, $value) = @_;
19 push @{ $OuterStack{ $file } }, $value;
27 unless @{ $OuterStack{ $file } || [] };
28 return pop @{ $OuterStack{ $file } };
31 sub outer_stack_peek {
35 unless @{ $OuterStack{ $file } || [] };
36 return $OuterStack{ $file }[-1];
43 MooseX::Declare::Util - Common declarative utility functions
47 This exporter collection contains the commonly used functions in L<MooseX::Declare>.
51 =head2 outer_stack_push
53 outer_stack_push (Str $file, Str $value)
55 Pushes the C<$value> on the internal stack for the file C<$file>.
57 =head2 outer_stack_pop
59 outer_stack_pop (Str $file)
61 Removes one item from the internal stack of the file C<$file>.
63 =head2 outer_stack_peek
65 outer_stack_peek (Str $file)
67 Returns the topmost item in the internal stack for C<$file> without removing
74 =item * L<MooseX::Declare>
78 =head1 AUTHOR, COPYRIGHT & LICENSE
80 See L<MooseX::Declare>