sid_com
sid_com

Reputation: 25117

"perldoc -f" for Perl6/Rakudo

Does for Perl6/Rakudo already exist something like perl5's "perldoc -f function_name" for build-in-functions which gives me a short and quick usage instruction?

Upvotes: 8

Views: 551

Answers (4)

teodozjan
teodozjan

Reputation: 913

Here is the tool you are looking for:

If you don't have it installed, install it with zef:

zef install p6doc

If you don't have zef installed, install it from zef's github repo.

Upvotes: 6

Plaute
Plaute

Reputation: 4889

Unfortunately, Perl6 doesn't come with a perldoc command. (Like Perl 5 in fact, even though most of Linux distributions, except Debian, come with a functional perldoc).

So you have to install it.

Following Perl6 documentation (https://docs.perl6.org/programs/02-reading-docs), you have to zef it.

zef install p6doc

... and on my Centos, it didn't work, because p6doc is installed in rakudo folder, not in a bin directory, groumpf.

So I ln it also :)

ln -s /opt/rakudo-pkg/share/perl6/site/bin/p6doc /usr/bin

Enjoy now, life in Perl world is always better with a perldoc at hand.

Upvotes: 3

Steve Mynott
Steve Mynott

Reputation: 59

The perl --doc is actually a red herring.

The command is "p6doc"

% p6doc
What documentation do you want to read?
Examples: p6doc Type::Str
          p6doc Type::Str.split

You can also look up specific method/routine definitions:
          p6doc -f push

Upvotes: 3

DVK
DVK

Reputation: 129403

Hmm... This may not be exactly what you want, but:

Perl6::Doc - all useful Perl 6 Docs in your command line

This includes p6doc command line utility, which can be used to read Synopses thusly:

p6doc s05    # Browse Synopsis 05

The full list of synopsis is available here: http://perlcabal.org/syn/ ; Perl 6's built-in functions is s29: http://perlcabal.org/syn/S29.html

I never saw an individual per-function documentation like perldoc -f fname, though.


Also, on a related note there's a Periodic Table of Perl 6 operators

Upvotes: 4

Related Questions