from

NAME

from - load a module and import selected items from it

SYNOPSIS

use from <Test &plan &ok>;  # only import "plan" and "ok"

plan 1;
ok "foo", "bar";  # ok 1 - bar

use from "Foo";  # use Foo, but don't import anything

use from <Test ! &skip>;  # import everything *except* skip

DESCRIPTION

The from distribution is a helper module that allows you to load any given module and only import selected items from whatever that module imports by default. This can be helpful when there is a conflict between different modules exporting something with the same name (such as skip in the Raku core, and the skip subroutine provided by Test.

The first argument indicates the name of the module to be loaded. If it is the only argument, then the module will be loaded without doing any of its imports (which is basically the same as need).

If the second argument is a sole exclamation mark, it indicates that the rest of the arguments are items that should not be imported.

The rest of the arguments indicate the items that should (not) be imported.

AUTHOR

Elizabeth Mattijsen <[email protected]>

Source can be located at: https://codeberg.org/lizmat/from . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2022, 2025, 2026 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

# vim: expandtab shiftwidth=4

from v0.0.5

load a module and import selected items from it

Authors

  • Elizabeth Mattijsen

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • from

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.