项目作者: domm

项目描述 :
Report interesting Perl module return values
高级语言: Perl
项目地址: git://github.com/domm/Acme-ReturnValue.git
创建时间: 2009-05-05T06:44:29Z
项目社区:https://github.com/domm/Acme-ReturnValue

开源协议:

下载


NAME

Acme::ReturnValue - report interesting return values

VERSION

version 1.004

SYNOPSIS

  1. use Acme::ReturnValue;
  2. my $rvs = Acme::ReturnValue->new;
  3. $rvs->in_INC;
  4. foreach (@{$rvs->interesting}) {
  5. say $_->{package} . ' returns ' . $_->{value};
  6. }

DESCRIPTION

Acme::ReturnValue will list ‘interesting’ return values of modules.
‘Interesting’ means something other than ‘1’.

See https://returnvalues.plix.at for the results of running Acme::ReturnValue on the whole CPAN.

METHODS

run

run from the commandline (via acme_returnvalue.pl

waste_some_cycles

  1. my $data = $arv->waste_some_cycles( '/some/module.pm' );

waste_some_cycles parses the passed in file using PPI. It tries to
get the last statement and extract it’s value.

waste_some_cycles returns a hash with following keys

  • file

    The file

  • package

    The package defintion (the first one encountered in the file

  • value

    The return value of that file

waste_some_cycles will also put this data structure into
interesting or boring.

You might want to pack calls to waste_some_cycles into an eval
because PPI dies on parse errors.

_is_code

Stolen directly from Perl::Critic::Policy::Modules::RequireEndWithOne
as suggested by Chris Dolan.

Thanks!

in_CPAN

Analyse CPAN. Needs a local CPAN mirror

in_INC

  1. $arv->in_INC;

Collect return values from all *.pm files in @INC.

in_dir

  1. $arv->in_dir( $some_dir );

Collect return values from all *.pm files in $dir.

in_file

  1. $arv->in_file( $some_file );

Collect return value from the passed in file.

If waste_some_cycles failed, puts information on the failing file into failed.

interesting

Returns an ARRAYREF containing ‘interesting’ modules.

boring

Returns an ARRAYREF containing ‘boring’ modules.

failed

Returns an ARRAYREF containing unparsable modules.

BUGS

Probably many, because I’m not sure I master PPI yet.

AUTHOR

Thomas Klausner domm@plix.at

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 - 2021 by Thomas Klausner.

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