NAME

Parse::Perl::Environment - reified Perl lexical environment

DESCRIPTION

An object of this class encapsulates a lexical environment for Perl source code. Such an object can be used to influence Perl parsing, through the parse_perl function in Parse::Perl. An environment object is most commonly generated by capturing the environment of running Perl code, through the current_environment operator in Parse::Perl.

The things determined by the lexical environment, which are encapsulated by this class, include:

  • current package (controlled by package directives)

  • activation of warnings (controlled by the warnings module)

  • enforcement of language stricture (controlled by the strict module)

  • availability of optional language features (controlled by the feature module)

  • various other standard pragmata, such as integer, locale, sort, utf8

  • array base offset ($[)

  • the lexical hints hash %^H, and hence the various (mainly non-core) pragmata that are implemented through it

  • visibility of lexical variables (introduced by my, our, or state)

Objects of this class are not meant to be examined manually. The layout varies between Perl versions, and between versions of the Parse::Perl module.

BUGS

This module provides no way to examine environments, or to create new environments other than by capturing an existing one. These shortcomings should be addressed in a future version.

SEE ALSO

Parse::Perl

AUTHOR

Andrew Main (Zefram) <zefram@fysh.org>

COPYRIGHT

Copyright (C) 2009, 2010, 2011, 2012 Andrew Main (Zefram) <zefram@fysh.org>

LICENSE

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.