"perldoc -f" for Perl6/Rakudo
Does for开发者_如何学C 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?
Here is the tool you are looking for:
- p6doc tool contains
-f
option - Online version
perl6 --doc
option
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.
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
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
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.
精彩评论