The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Perl::Critic::StricterSubs::Utils

AFFILIATION

This module is part of Perl::Critic::StricterSubs.

DESCRIPTION

This module holds utility methods that are shared by other modules in the Perl::Critic::StricterSubs distro. Until this distro becomes more mature, I would discourage you from using these subs outside of this distro.

IMPORTABLE SUBS

parse_quote_words( $qw_elem )

Gets the words from a PPI::Token::Quotelike::Words.

parse_simple_list( $list_node )

Returns the string literals from a PPI::Structure::List.

parse_literal_list( @nodes )

Returns the string literals contained anywhere in a collection of PPI::Nodes.

get_package_names_from_include_statements( $doc )

Returns a list of module names referred to with a bareword in an include statement which is directly in the document or a BEGIN, CHECK, or INIT block.

get_package_names_from_package_statements( $doc )

Returns a list of all the namespaces from all the packages statements that appear in the document.

find_exported_sub_names( $doc, @export_types )

Returns a list of subroutines which are exported via the specified export types. If @export_types is empty, it defaults to qw{ @EXPORT, @EXPORT_OK }.

Subroutine names are returned as in get_all_subs_from_list_of_symbols().

get_all_subs_from_list_of_symbols( @symbols )

Returns a list of all the input symbols which could be subroutine names.

Subroutine names are considered to be those symbols that don't have scalar, array, hash, or glob sigils. Any subroutine sigils are stripped off; i.e. &foo will be returned as "foo".

SEE ALSO

Exporter

AUTHOR

Jeffrey Ryan Thalhammer <thaljef@cpan.org>

COPYRIGHT

Copyright (c) 2007 Jeffrey Ryan Thalhammer. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.