7

Either I've missed it or there's no clear information about that topic.

  1. Where should I look for Perl 6 libraries? CPAN.org? Or only http://modules.perl6.org?

  2. When I've chosen one, how can I add it to my Perl 6 project?

  3. If I find it on GitHub, how can I add it to my Perl 6 project?

Elizabeth Mattijsen
  • 25,654
  • 3
  • 75
  • 105

2 Answers2

5

Please make sure to read @smonff's answer as well for responses to questions 2 and 3.

  1. Where should I look for perl 6 libraries?

modules.perl6.org.

  1. When I've chosen one, how can I add it to my perl 6 project?

Use zef to install it on your local system.

Read the modules doc page for directions on useing a module in your project.

  1. If I find it [somewhere], how can I add it to my perl 6 project?

If zef can see it (and zef will usually be able to see a module if its repo is listed at modules.perl6.org) then zef should be able to install it. If not, contact the author or ask about it on #perl6.

raiph
  • 31,607
  • 3
  • 62
  • 111
4

As an answer to point 2) and 3) , you can take a look at 6pm. It's idea is to be NPM for Perl6. It could also be compared to Perl5's Carton. 6pm works over Zef.

$ 6pm init

# Install dependencies to ./perl6-modules and add it to META6.json 
$ 6pm install Test::Meta --save

# Run a file using the local dependencies
$ 6pm exec-file test.p6

# Make your code always use 6pm by making it "use SixPM;"
$ perl6 test.p6

See the full documentation for more information.

smonff
  • 3,399
  • 3
  • 36
  • 46