me::inlined - EXPERIMENTAL - define multiple packages in one file, and reference them in any order
version 0.004
before:
package Foo; package Bar; use Foo; # kaboom: "Can't locate Foo.pm in @INC"
after:
package Foo; use me::inlined; package Bar; use Foo; # no kaboom!
If you've ever defined multiple packages in the same file, but want to use one package in another, you'll have discovered why it's much easier to simply follow best practices and define one package per file.
use
However, this module will let you minimize your inode usage: simply add use me::inlined in any package that you want to refer to in other namespaces in the same file, and you can (probably) safely define and use packages in any order.
use me::inlined
This will also let you do require Foo; in other code, after the .pm file containing Foo has been loaded, without require complaining that it cannot find Foo.pm in @INC.
require Foo;
Foo
require
@INC
This module is for demonstration purposes only, and in no way am I recommending you use this in any real code whatsoever.
There is no public API other than the use directive itself, which takes no arguments.
There may be edge cases where this doesn't work right, or leads to infinite looping when trying to compile modules. Use at your own risk!
This module was inspired by a conversation witnessed on modules@perl.org -- credit for the idea belongs to Linda Walsh.
modules@perl.org
mem
thanks
Bugs may be submitted through the RT bug tracker (or bug-me-inlined@rt.cpan.org).
I am also usually active on irc, as 'ether' at irc.perl.org.
irc.perl.org
Karen Etheridge <ether@cpan.org>
Neil Bowers <neil@bowers.com>
This software is copyright (c) 2013 by Karen Etheridge.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install me::inlined, copy and paste the appropriate command in to your terminal.
cpanm
cpanm me::inlined
CPAN shell
perl -MCPAN -e shell install me::inlined
For more information on module installation, please visit the detailed CPAN module installation guide.