NAME

anywhere - Use a module (or feature) everywhere

VERSION

This document describes version 0.002 of anywhere (from Perl distribution anywhere), released on 2017-02-14.

SYNOPSIS

#!/usr/bin/perl

use strict;
use anywhere qw/ feature say /;
use Greet;

Greet::hello();

# in Greet.pm
package Greet;
use strict;
sub hello {
  say "Helloooooo!!!!";
}

DESCRIPTION

anywhere is a fork of everywhere 0.07 while waiting my proposed change to be merged (if ever). It currently only has one difference compared to everywhere: it sets %INC entry to the file path instead of letting Perl set it to CODE(0x...) so other modules see the used module more normally and anywhere can work with things like true.

The rest is from everywhere documentation:

I got tired of putting "use 5.010" at the top of every module. So now I can throw this in my toplevel program and not have to Repeat Myself elsewhere.

In theory you should be able to pass it whatever you pass to use.

Also, I just made it so you can do:

use anywhere 'MooseX::Declare',
  matching => '^MyApp',
  use_here => 0;

for example and then it will only apply this module to things matching your regex. And not use it here. You can also throw in 'package_level => 1' to use your package after every "package ..." line. All these are experimental :)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/anywhere.

SOURCE

Source repository is at https://github.com/perlancar/perl-anywhere.

EVERYWHERE'S BUGS

Currently you can only use this once.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=anywhere

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

https://rt.cpan.org/Public/Bug/Display.html?id=120238

Acme::use::strict::with::pride -- from which most code came!

Also look at use and feature.

EVERYWHERE'S AUTHOR

Brock Wilcox <awwaiid@thelackthereof.org> - http://thelackthereof.org/
Thanks to mst and #moose ;-)

AUTHOR

perlancar <perlancar@cpan.org>

EVERYWHERE'S COPYRIGHT

Copyright (c) 2008-2011 Brock Wilcox <awwaiid@thelackthereof.org>. All rights
reserved.  This program is free software; you can redistribute it and/or
modify it under the same terms as Perl 5.10 or later.

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by perlancar@cpan.org.

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