View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
☺唐鳳☻ > Perl6-Pugs-6.2.7 > pugs



Annotate this POD


New  7
Open  0
View/Report Bugs
Module Version: 0.02   Source  


pugs - Perl6 User's Golfing System


pugs [OPTIONS]

perl -e 'use pugs; # perl 6 code here...'


This manual describes Pugs, an experimental (but useful) implementation of the Perl6 language.

Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).

If you're new to Pugs, you should start with pugs::intro (yet to be written), which is a general intro for beginners and provides some background to help you navigate the rest of Perl's extensive documentation.

(pugs is also a Perl5 pragma for using Perl6 code inline. See "The pugs pragma" below.)

For ease of access, the Pugs manual has been split up into several sections. Those marked with an asterix haven't been written yet.


    pugs                Perl overview (this section)
    pugs::intro       * Perl introduction for beginners
    pugs::toc         * Perl documentation table of contents


    pugs::run           Perl execution and options
                      * (many others)

Internals and Foreign Language Interfaces

    pugs::hack          An overview of the Pugs source tree

You should be able to view Perl's documentation with your man(1) program or perldoc(1).


[This section describes a Perl 5 pragma named pugs. Hopefully this is not too confusing.]

    use pugs;   # Here is some Perl 6 code...
    sub postfix:<!> { [*] 1..$_ }
    sub sum_factorial { [+] 0..$_! }
    no pugs;    # Here is some Perl 5 code...
    print sum_factorial(3); # 21

The (Perl 5) pugs module lets you put Perl 6 code in Perl 5 source code after a line of:

    use pugs;

To switch back to Perl 5:

    no pugs;

See also Perl6::Pugs. The pugs pragma was written by Brian Ingerson <> .


Pugs is available for most operating systems to which GHC has been ported, including many Unix-like platforms as well as (with several limitations) Windows. See "Supported Platforms" in perl::port for a listing (to be written), and the README file in the source distribution.


See pugs::run.


Perl was conceived and nurtured by Larry Wall <>.

Pugs was written by Autrijus Tang <>, with the help of oodles of other folks; see the AUTHORS file.


Pugs is still under heavy development. If you find a bug, please report it (with a test case, if possible -- see t/README) on #perl6 on

syntax highlighting: