# [[[ HEADER ]]]
use RPerl;
package RPerl::Learning;
use strict;
use warnings;
our $VERSION = 0.195_000;
# [[[ OO INHERITANCE ]]]
# NEED FIX: why does the following 'use parent' command cause $VERSION to become undefined???
#use parent qw(RPerl::CompileUnit::Module::Class);
#use RPerl::CompileUnit::Module::Class;
# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
## no critic qw(ProhibitUnreachableCode RequirePodSections RequirePodAtEnd)  # DEVELOPER DEFAULT 1b: allow POD & unreachable or POD-commented code, must be after line 1
# [[[ OO PROPERTIES ]]]
our hashref $properties = {};
1;    # end of class
__END__
=encoding utf8
=for comment DEV NOTE: BEGIN INLINE CSS DIV
=begin html
=end html
=head1 NAME
Learning RPerl
=head1 COPYRIGHT
Learning RPerl is Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 William N. Braswell, Jr.
All Rights Reserved.
Learning RPerl is part of the RPerl Family of software and documentation.
=head1 BOOK TITLE
=begin text
    .;,..                                                                                                                                               
    .2prp02;'.                                                                                                                                          
      ,0LRRRLLp1;.                                                                                                                                      
      .,20LRPEEPRL02'.                                                                                                                                  
        .'2rREEEEPRRLp1:,.                                                                                                                              
           .1pLRPEEEPRRLLrl;.                                                                                                                           
            .;2lpLREEEEEPRRLpl2,.                                                                                                                       
             .':lrLPEEEPPPPPRRLLpl:,.                                                                                                                   
                .'20LRPPPPPPPEEPRLLrpl:'.                                                                                                               
                    .2rLRPPRRPPPEEPRRLLrp1;'.                                                                                                           
                      .;lpLRRRRRPPPEEEPLLLrr0:'.                                                                                                        
                         .,1LRRRLLRPPPRRRRLLLrr01,.                                                                                                     
                            .,1pLRRRRLLRRRRRLLLLrrpl:'.                                                                                                 
                                .:lrLRRLLRLLLLLLLrrrrp02,.                                                                                              
                                   ..:lpLRRRRLLLLLLLrppp002,.                                                                                           
                                       .';1pLLRRLLLrpprpp0ppl2,.                                                                                        
                                           .'1prLRRLLrpprLrrrLLL0:.                                                        ....                         
                                             ..;1pLLLLLLLLLLLLLLLLr0:.                                                   '0LLLLr01;..                   
                                                .;20rrrLLLLLLLLrprLLLrl:'.                                              'rEEEEEEEEPRL1,.                
                                                   .':10pLLLLLLLLLrp0pprp02;..                                          ;LPPEPPEEPPPRLLp2.              
                                                       .';1rLLrrrrpppp0000pp0l1;'..            ...',;::2222222::;,'..    2REEPPPPPPRRLLrrp2.            
                                                           .,20rLLrrrrrpppppprrrrrrrpl2:221lppprLLRPPPPEEEEEEEEEEPERLL021LEEPPLrprrprrpppLL0.           
                                                               .,1prprprrrLLLLRPPPEEEEPPPPPPRPPRRRRRLLRRPE333EEEE3EE33333EPRPERLpppprp000prLp1:,..      
                                                                  .,20rrppLRPPEEEEEEEEEEEEPPRRRRLLLLLLLRRPPPPPRRRPPEE33333PREEEEEPRLppp0pplll0p0001:'.  
                                                                     .';20LPEEEEEEEEE3EEEEEPPRRLLLLLLLLLLRRLLLLLLLRPPEPPEEERLLLLLLLrrrpl0l;'..'',;;::,. 
                                                                         '0LPEEEEEEEEEEPRRPPPRRRRLLLLrrLLrrLrprLLLrrLLLrLLL010prrLLrpp00:.              
                                                                           ;rRPEE3EPPEERLLLLRPPLLLLLrrp0ll0p0l0p0l112:1lll2:1lll0l0pLLRp.               
                                                                            ':lREPPEPPPRLRPEERLLLLrprLLLr0ll01:1l1::12::::2::2::::1120L0.               
                                                                          .:0prLPPPPRLLRPPRRLLLrrrLLLLRRPLpll2:;::;,:12::::,,,;;;::;:200,               
                                                                        .:0LLRRRPRPEPLLLLRRLrrLRRRRRLLLLrpp00l2:2222112211:,,,'',;:,,2l0,               
                                                                         ...'',:1lpLRRLRLLLLLLLREEEEERrppppp0ppl11lp0pp0012:;;,,;;;,;2l1.               
                                                                                   .,1rRPPPPPPRRPEEEEPLrLLrrpprLLLLrrrLrrp1:;;,;::;;20l;                
                                                                                      .:LEEEPRrpppppppppprLLRPPPRRRRRLrrp0l2222::22101'                 
                                                                                        'rPPPLplll121llll0pprrrpppprLr0l12222221lll2'.                  
                                                                                         .;0PPRLLrpll11222:;;,,,,:10rrrrrrrp0ll1:;.                     
                                                                                           .1RLrRRLLr02:;,........,;:;;;;;,'..                          
                                                                                             2r22rLrpp1;.                                               
                                                                                             .lL2;1l12'                                                 
                                                                                              .0L;.2L0.                                                 
                                                                                         ,2:'. ,rp;,0L0.   .,2;..                                       
                                                                                         .:1l00pLLrprRPp2221ll,.                                        
                                                                                          .',,;;;,,;:10Lr1'.                                            
                                                                                                       '0l'                                             
                                                                                                        .ll'                                            
                                                                                                    ':::2pp1:,.....',.                                  
                                                                                                 ..'';2ll1;,;::21l111;..                                
                                                                                                 ..,'...       ...',;;...                               
=end text
=begin man
    .;,..                                                                                                                                               
    .2prp02;'.                                                                                                                                          
      ,0LRRRLLp1;.                                                                                                                                      
      .,20LRPEEPRL02'.                                                                                                                                  
        .'2rREEEEPRRLp1:,.                                                                                                                              
           .1pLRPEEEPRRLLrl;.                                                                                                                           
            .;2lpLREEEEEPRRLpl2,.                                                                                                                       
             .':lrLPEEEPPPPPRRLLpl:,.                                                                                                                   
                .'20LRPPPPPPPEEPRLLrpl:'.                                                                                                               
                    .2rLRPPRRPPPEEPRRLLrp1;'.                                                                                                           
                      .;lpLRRRRRPPPEEEPLLLrr0:'.                                                                                                        
                         .,1LRRRLLRPPPRRRRLLLrr01,.                                                                                                     
                            .,1pLRRRRLLRRRRRLLLLrrpl:'.                                                                                                 
                                .:lrLRRLLRLLLLLLLrrrrp02,.                                                                                              
                                   ..:lpLRRRRLLLLLLLrppp002,.                                                                                           
                                       .';1pLLRRLLLrpprpp0ppl2,.                                                                                        
                                           .'1prLRRLLrpprLrrrLLL0:.                                                        ....                         
                                             ..;1pLLLLLLLLLLLLLLLLr0:.                                                   '0LLLLr01;..                   
                                                .;20rrrLLLLLLLLrprLLLrl:'.                                              'rEEEEEEEEPRL1,.                
                                                   .':10pLLLLLLLLLrp0pprp02;..                                          ;LPPEPPEEPPPRLLp2.              
                                                       .';1rLLrrrrpppp0000pp0l1;'..            ...',;::2222222::;,'..    2REEPPPPPPRRLLrrp2.            
                                                           .,20rLLrrrrrpppppprrrrrrrpl2:221lppprLLRPPPPEEEEEEEEEEPERLL021LEEPPLrprrprrpppLL0.           
                                                               .,1prprprrrLLLLRPPPEEEEPPPPPPRPPRRRRRLLRRPE333EEEE3EE33333EPRPERLpppprp000prLp1:,..      
                                                                  .,20rrppLRPPEEEEEEEEEEEEPPRRRRLLLLLLLRRPPPPPRRRPPEE33333PREEEEEPRLppp0pplll0p0001:'.  
                                                                     .';20LPEEEEEEEEE3EEEEEPPRRLLLLLLLLLLRRLLLLLLLRPPEPPEEERLLLLLLLrrrpl0l;'..'',;;::,. 
                                                                         '0LPEEEEEEEEEEPRRPPPRRRRLLLLrrLLrrLrprLLLrrLLLrLLL010prrLLrpp00:.              
                                                                           ;rRPEE3EPPEERLLLLRPPLLLLLrrp0ll0p0l0p0l112:1lll2:1lll0l0pLLRp.               
                                                                            ':lREPPEPPPRLRPEERLLLLrprLLLr0ll01:1l1::12::::2::2::::1120L0.               
                                                                          .:0prLPPPPRLLRPPRRLLLrrrLLLLRRPLpll2:;::;,:12::::,,,;;;::;:200,               
                                                                        .:0LLRRRPRPEPLLLLRRLrrLRRRRRLLLLrpp00l2:2222112211:,,,'',;:,,2l0,               
                                                                         ...'',:1lpLRRLRLLLLLLLREEEEERrppppp0ppl11lp0pp0012:;;,,;;;,;2l1.               
                                                                                   .,1rRPPPPPPRRPEEEEPLrLLrrpprLLLLrrrLrrp1:;;,;::;;20l;                
                                                                                      .:LEEEPRrpppppppppprLLRPPPRRRRRLrrp0l2222::22101'                 
                                                                                        'rPPPLplll121llll0pprrrpppprLr0l12222221lll2'.                  
                                                                                         .;0PPRLLrpll11222:;;,,,,:10rrrrrrrp0ll1:;.                     
                                                                                           .1RLrRRLLr02:;,........,;:;;;;;,'..                          
                                                                                             2r22rLrpp1;.                                               
                                                                                             .lL2;1l12'                                                 
                                                                                              .0L;.2L0.                                                 
                                                                                         ,2:'. ,rp;,0L0.   .,2;..                                       
                                                                                         .:1l00pLLrprRPp2221ll,.                                        
                                                                                          .',,;;;,,;:10Lr1'.                                            
                                                                                                       '0l'                                             
                                                                                                        .ll'                                            
                                                                                                    ':::2pp1:,.....',.                                  
                                                                                                 ..'';2ll1;,;::21l111;..                                
                                                                                                 ..,'...       ...',;;...                               
=end man
=for man
=begin docbook
    .;,..                                                                                                                                               
    .2prp02;'.                                                                                                                                          
      ,0LRRRLLp1;.                                                                                                                                      
      .,20LRPEEPRL02'.                                                                                                                                  
        .'2rREEEEPRRLp1:,.                                                                                                                              
           .1pLRPEEEPRRLLrl;.                                                                                                                           
            .;2lpLREEEEEPRRLpl2,.                                                                                                                       
             .':lrLPEEEPPPPPRRLLpl:,.                                                                                                                   
                .'20LRPPPPPPPEEPRLLrpl:'.                                                                                                               
                    .2rLRPPRRPPPEEPRRLLrp1;'.                                                                                                           
                      .;lpLRRRRRPPPEEEPLLLrr0:'.                                                                                                        
                         .,1LRRRLLRPPPRRRRLLLrr01,.                                                                                                     
                            .,1pLRRRRLLRRRRRLLLLrrpl:'.                                                                                                 
                                .:lrLRRLLRLLLLLLLrrrrp02,.                                                                                              
                                   ..:lpLRRRRLLLLLLLrppp002,.                                                                                           
                                       .';1pLLRRLLLrpprpp0ppl2,.                                                                                        
                                           .'1prLRRLLrpprLrrrLLL0:.                                                        ....                         
                                             ..;1pLLLLLLLLLLLLLLLLr0:.                                                   '0LLLLr01;..                   
                                                .;20rrrLLLLLLLLrprLLLrl:'.                                              'rEEEEEEEEPRL1,.                
                                                   .':10pLLLLLLLLLrp0pprp02;..                                          ;LPPEPPEEPPPRLLp2.              
                                                       .';1rLLrrrrpppp0000pp0l1;'..            ...',;::2222222::;,'..    2REEPPPPPPRRLLrrp2.            
                                                           .,20rLLrrrrrpppppprrrrrrrpl2:221lppprLLRPPPPEEEEEEEEEEPERLL021LEEPPLrprrprrpppLL0.           
                                                               .,1prprprrrLLLLRPPPEEEEPPPPPPRPPRRRRRLLRRPE333EEEE3EE33333EPRPERLpppprp000prLp1:,..      
                                                                  .,20rrppLRPPEEEEEEEEEEEEPPRRRRLLLLLLLRRPPPPPRRRPPEE33333PREEEEEPRLppp0pplll0p0001:'.  
                                                                     .';20LPEEEEEEEEE3EEEEEPPRRLLLLLLLLLLRRLLLLLLLRPPEPPEEERLLLLLLLrrrpl0l;'..'',;;::,. 
                                                                         '0LPEEEEEEEEEEPRRPPPRRRRLLLLrrLLrrLrprLLLrrLLLrLLL010prrLLrpp00:.              
                                                                           ;rRPEE3EPPEERLLLLRPPLLLLLrrp0ll0p0l0p0l112:1lll2:1lll0l0pLLRp.               
                                                                            ':lREPPEPPPRLRPEERLLLLrprLLLr0ll01:1l1::12::::2::2::::1120L0.               
                                                                          .:0prLPPPPRLLRPPRRLLLrrrLLLLRRPLpll2:;::;,:12::::,,,;;;::;:200,               
                                                                        .:0LLRRRPRPEPLLLLRRLrrLRRRRRLLLLrpp00l2:2222112211:,,,'',;:,,2l0,               
                                                                         ...'',:1lpLRRLRLLLLLLLREEEEERrppppp0ppl11lp0pp0012:;;,,;;;,;2l1.               
                                                                                   .,1rRPPPPPPRRPEEEEPLrLLrrpprLLLLrrrLrrp1:;;,;::;;20l;                
                                                                                      .:LEEEPRrpppppppppprLLRPPPRRRRRLrrp0l2222::22101'                 
                                                                                        'rPPPLplll121llll0pprrrpppprLr0l12222221lll2'.                  
                                                                                         .;0PPRLLrpll11222:;;,,,,:10rrrrrrrp0ll1:;.                     
                                                                                           .1RLrRRLLr02:;,........,;:;;;;;,'..                          
                                                                                             2r22rLrpp1;.                                               
                                                                                             .lL2;1l12'                                                 
                                                                                              .0L;.2L0.                                                 
                                                                                         ,2:'. ,rp;,0L0.   .,2;..                                       
                                                                                         .:1l00pLLrprRPp2221ll,.                                        
                                                                                          .',,;;;,,;:10Lr1'.                                            
                                                                                                       '0l'                                             
                                                                                                        .ll'                                            
                                                                                                    ':::2pp1:,.....',.                                  
                                                                                                 ..'';2ll1;,;::21l111;..                                
                                                                                                 ..,'...       ...',;;...                               
=end docbook
=for html 

=for html 
B
=for html 
~ or ~
=for html 
B
=for html 
~ affectionately known as ~
=for html 
B
=for html 
.
X
...
X
.....
X
.......
X
being
X
.......
X
.....
X
...
X
.
B
~ for ~
B
X
=head1 DEDICATION
For Anna.
X
=head1 EDITION
0th Edition, Pre-Release Copy
X
=head1 TABLE OF CONTENTS: CHAPTERS AT-A-GLANCE
=over
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=back
X
=head1 FOREWORD
[ INSERT FOREWORD CONTENT HERE ]
X
=head1 PREFACE
=head2 Section 0.1: Who I Am
My name is William N. Braswell, Jr.; I am also known by a number of other names including Will the Chill, The Voice In The Wilderness, Skipper Brassie ("braz-ee"), and just Will.
I have a degree in computer science and mathematics from Texas Tech University, I have worked as a Perl software developer for over 15 years, and I am the founder of the Auto-Parallel Technologies consulting company.
L
L
I am 1 of 3 co-founders of the Perl 11 movement.
L
I am also the President of the Austin Perl Mongers.
L
Most importantly, I am the creator of the RPerl optimizing compiler for Perl 5, about which you are currently reading!
L
=head2 Section 0.2: Why I Wrote This Book
Using RPerl is different enough from normal Perl 5 to necessitate the creation of in-depth user documentation.
Manual pages and cookbooks and example source code alone are not enough, only a full textbook can provide the level of detail necessary to truly learn RPerl.
This is that textbook.
=head2 Section 0.3: History Of This Book
RPerl v1.0 was released on US Independence Day, July 4th, 2015; 6 days later, work began on the source code solution to exercise 1 of chapter 1 of this book:
L
Significant GitHub commit dates may be viewed by forking the RPerl git repository and executing the following C command:
=for rperl X
    $ git log --reverse --all --date=short --pretty='%cd: %s' | grep 'Learning RPerl'
    2015-07-10: Learning RPerl, Chapter 1, Exercise 1, Hello World
    ...
=for rperl X
=head2 Section 0.4: TPF Grants
This book was made possible in part by 2 generous grants from The Perl Foundation, as part of the September 2015 and January / February 2016 rounds of funding.
Special thanks to TPF Grants Committee Secretary, Makoto Nozaki; TPF Grant Manager, Mark Jensen; TPF Grants Committee's various supporting members; and everyone who gave positive feedback on the grant proposals.
A history of TPF grant #1 may be found at the following links:
=over 16
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=item * L
=back
A history of TPF grant #2 may be found at the following links:
=over 16
=item * L
=item * L Feb 2016 Grant Votes|http://news.perlfoundation.org/2016/02/janfeb-2016-grant-votes.html>
=back
=head2 Section 0.5: Acknowledgements & Thanks
Countless people have contributed to the development of RPerl; from source code to bug testing to financial donations to emotional support, it truly takes a village to build a compiler!
Below are the contents of the official RPerl thank-you file, listing the handles (online nicknames) and names of the most important RPerl contributors.  If you don't already know who these people are, you will be pleasantly surprised by researching each of them.
L
=for rperl X
    Many Thanks To irc.perl.org:
    #perl5 Founder timtoady
    #perl6 Founder timtoady (again)
    #perl11 Founders ingy & rurban & willthechill (yours truly)
    #perl11 Members bulk88 & mst
    #inline Founders ingy (again) & nwatkiss
    #inline Members davido & mohawk & sisyphus
    Additional Thanks To:
    Eyapp Creator Casiano Rodriguez-Leon, PhD
    Austin Perl Mongers
    All RPerl Contributors & Users & Supporters
=for rperl X
=head2 Section 0.6: Defense / Apology
I'm sure I will make errors while writing this book.
I may even upset some people, particularly those who have an emotional or financial investment in slow Perl software.
Despite my best efforts, I remain a fallible human being; thus, bad spelling and grammer and run-on sentences and parts that are hard to understand and parts that are not funny and formattiNg errors and bad spelling adn repetitions and other annoyances will doubtless plague this tome but we must not allow such trivialities as, improper punctuation to affect our willingness and ability to learn how to write super-fast RPerl software.
If you find a mistake in this book (other than in the immediately preceding paragraph), please utilize the following link to create a new GitHub issue (bug report) using a title starting with the words "Learning RPerl":
L
I will try my best to create an engaging and educational experience for you, the reader; however, in anticipation of the inevitable disappointment you may experience, I can only humbly offer...
B
=head2 Section 0.7: POD
"The Pod format is not necessarily sufficient for writing a book."
L
~ Saint Larry Wall & Sean M. Burke
X
"Challenge accepted."
L
~ Will Braswell
X
=head1 CHAPTER 1: INTRODUCTION
=head2 Section 1.1: Welcome To The Roadrunner Book!
You are about to learn the basic concepts of writing software using the RPerl optimizing compiler for the Perl computer programming language.  With the skills gained by reading this book, you will be empowered to create new super-fast RPerl programs which can be intermixed with the enormous amount of existing Perl software available on the Internet.
This book is named and stylized for the animal mascot for RPerl, Roadie the Roadrunner.  RPerl, like Roadie, I<"runs really fast">.
Throughout this text, the following 14 typography conventions are utilized:
=over
=item * "Literal Quotation"
=item * I<"First Occurrence Of Key Concept">
=item * I
=item * B
=item * F
=item * B>
=for html 
=item * B
=item * I
=for html 
=item * L
=item * C<$code_snippet = 'unhighlighted';>
=item * C<`command_line_program.pl --with --arguments`>  (Only Include Characters Between `Backquotes` When Running Command; Discard Backquote Characters Themselves)
=item * ...
    my string $code_block = 'highlighted on RPerl.org & MetaCPAN.org';  # with comments
    my integer $more_code = 17;  # http://www.catb.org/jargon/html/R/random-numbers.html
    return 'end of indented code block';
=item * ...
=for rperl X
    $ command_line_program.pl --with --arguments
    Please provide input: foo bar
    Your output is:       howdy howdy howdy
=for rperl X
=item * ...
=for rperl X
    Documentation referring to `command_line_program.pl --with --arguments` among other things.
    When executed, the above command accepts as input the string 'foo bar',
    and displays as output the string 'howdy howdy howdy'.
=for rperl X
=back
=head2 Section 1.2: Learning Perl
=begin text
This book is purposefully patterned after the popular educational text B, affectionately known as the Llama Book.  Both the Roadrunner Book and the Llama book are meant as introductory texts on Perl topics.  The Llama Book is focused on normal Perl, and the Roadrunner Book is focused on optimized Perl.
This book copies the same chapter topics as B, but all content is re-written for RPerl.  B also copies the same exercise concepts as B, but all solutions are re-written in RPerl.  Both books are canonical and may be used together in the classroom; the source code solutions are meant to be compared side-by-side as textbook examples of normal Perl versus optimized Perl.
Please support the Perl community by purchasing a copy of B from our friends at O'Reilly:
=end text
=begin html
This book is purposefully patterned after the popular educational text Learning Perl, affectionately known as the Llama Book.  Both the Roadrunner Book and the Llama book are meant as introductory texts on Perl topics.  The Llama Book is focused on normal Perl, and the Roadrunner Book is focused on optimized Perl.
This book copies the same chapter topics as Learning Perl, but all content is re-written for RPerl.  Learning RPerl also copies the same exercise concepts as Learning Perl, but all solutions are re-written in RPerl.  Both books are canonical and may be used together in the classroom; the source code solutions are meant to be compared side-by-side as textbook examples of normal Perl versus optimized Perl.
Please support the Perl community by purchasing a copy of Learning Perl, 7th Edition from our friends at O'Reilly:
=end html
L
=head2 Section 1.3: Is This Book A Good Choice For You?
=over
=item * Are you totally new to computer programming, and you want to learn how to write your first program?
=item * Do you already know Perl, and now you want to make your Perl code run faster?
=item * Do you already know some other computer language, and Perl has always intrigued you?
=item * Do you love learning about new languages and compilers?
=item * Do you miss your favorite old language Perl, and you're looking for a legitimate reason to go back?
=item * Are you a scientist and you just want your code to run really fast without the headaches of C or C++?
=back
If you answered "yes" to any of these questions, then the Roadrunner Book is definitely for you!
If you answered "no" to all of these questions, then this book may still be for you, give it a try!
If you hate Perl, or only love slow software, or wish all computers would explode, then we suggest some soul-searching and a L L L L.  You'll thank us in the morning.
=head2 Section 1.4: Why Aren't There More Footnotes?
This is a purposefully simple book, in the same way RPerl is a purposefully simple subset of the full Perl 5 programming language.
=head2 Section 1.5: What About Educational Programming Exercises?
There are one or more programming exercises at the end of every chapter, and full answers to each problem are given near the end of the book in Appendix A.
For maximum educational effect, we suggest you attempt to write each piece of code on your own before looking at our solutions.
If you are using this as an official textbook for certification or academic credit, such as at LAMPuniversity.org or a traditional school, you are obviously expected to write all your own code without referring to our or anyone else's solutions whatsoever.  We suggest you enclose Appendix A with a paper clip or discard it altogether to avoid the potential for accidental academic dishonesty.
=head2 Section 1.6: How Long Should Each Exercise Take To Complete?
The numbers at the beginning of each exercise indicate the approximate number of minutes required for an average person to reach a full working solution.  If it takes you less time, good for you!  If it takes you more time, don't worry, it's no big deal; learning technical skills requires time and dedication.  All experts were once novices.
=head2 Section 1.7: What If I Want To Teach RPerl?
Thank you for helping spread the love of Perl and the speed of RPerl!
As previously mentioned, this book may either be used solo or combined with the Llama Book.  For students who are not already familiar with Perl, you may wish to use this text alone in order to simplify and ease the learning experience.  For students who are already familiar with Perl or other dynamic programming languages like the snake or the red gemstone, you may wish to use both textbooks for a more in-depth compare-and-contrast approach.
=head2 Section 1.8: What Does The Name RPerl Actually Mean?
RPerl stands for I<"Restricted Perl">, in that we restrict our use of Perl to those parts which can be made to run fast.  RPerl also stands for I<"Revolutionary Perl">, in that we hope RPerl's speed will revolutionize the software development industry, or at least the Perl community.  RPerl might even stand for I<"Roadrunner Perl">, in that it I.
=head2 Section 1.9: Why Did Will Invent RPerl?
Will loves Perl and the Perl community.
Will is a scientist and needs his code to run really fast.
Will doesn't like the hassle of writing code in C or C++ or XS or Inline::C or Inline::CPP.
Will waited a decade or two before realizing he had to do it himself.
=head2 Section 1.10: Why Didn't Will Just Use Normal Perl?
Dynamic languages like Perl are fast at running some kinds of computational actions, such as regular expressions (text data pattern matching) and reading from a database.
Unfortunately, dynamic languages are slow at running general-purpose computations, such as arithmetic and moving data around in memory.  Sometimes very slow.
Dynamic languages like Perl are also flexible, powerful, and relatively easy to learn.  Sometimes too flexible.
RPerl's goal is to keep all of Perl's power and ease-of-use, while removing the redundant parts of Perl's flexibility in order to gain a major runtime speed boost.
The most complex and flexible parts of Perl are called I<"high magic">, so RPerl is focused on supporting the I<"low magic"> parts of Perl which can be made to run fast.
=head2 Section 1.11: Is RPerl Simple Or Complicated?
RPerl is specifically designed to remove the confusing and overly-complicated parts of Perl.
RPerl also introduces a number of additional rules and templates which are not present in normal Perl, notably including the use of real data types.
The net effect of removing Perl complexity and adding RPerl rules falls in favor of RPerl, due primarily to the exceedingly complex nature of Perl.
In other words, RPerl is easier to learn and use than dynamic languages like normal Perl, and most any other language in general.
=head2 Section 1.12: How Is RPerl Being Promoted?
The RPerl team has been regularly promoting RPerl in a number of physical and digital venues, including but not limited to:
=over
=item * YAPC::NA  L
=item * Austin Perl Mongers  L
=item * RPerl Website  L
=item * Github  L
=item * Facebook Page  L
=item * Facebook Groups  L  L
=item * Twitter  L
=item * PerlMonks  L
=item * Perl Blogs  L
=item * IRC #perl11  L
=back
=head2 Section 1.13: What Is The RPerl Community Up To?
As of US Independence Day 2016, RPerl v2.0 (codename I) has been publicly released and is in use by a number of early adopters around the world.
RPerl development is proceeding with financial support from both Kickstarter crowdfunding and official grant monies from The Perl Foundation.
The RPerl community is beginning to grow, and there are a number of exciting RPerl projects currently in the works.
If you would like to create software libraries and applications (AKA "programs" or "apps") to be utilized by end-users, then please join the RPerl application developers group, also known as the "RPerl App Devs":
L
L
=head2 Section 1.14: What Is RPerl Meant To Do?
RPerl is a general-purpose programming language, which means you can use RPerl to efficiently and effectively implement virtually any kind of software you can imagine.
RPerl is especially well-suited for building software which benefits from speed, such as scientific simulations and graphical video games.
RPerl is also good for building software which utilizes Perl's strong-suit of string manipulation; RPerl currently supports basic string operators, with full regular expression support to be added in an upcoming version.
=head2 Section 1.15: What Is RPerl Not Meant To Do?
RPerl has purposefully disabled the most complex features of Perl, such as runtime code evaluation, secret operators, and punctuation variables.  If you have purposefully designed your Perl software to depend on these high-magic features, or you are unconditionally committed to continue using high-magic language features, then maybe RPerl isn't for you.
=head2 Section 1.16: How Can I Download & Install RPerl?
Installing RPerl ranges from easy to difficult, depending on how well your operating system supports Perl and C++.
On modern operating systems with good Perl support, such as Debian or Ubuntu GNU/Linux, you should be able to install RPerl system-wide by running the following command at your terminal command prompt:
=for rperl X
    $ sudo cpan RPerl
=for rperl X
You may also choose to use the C<`cpanm`> command for simplicity, or the C tool for single-user (not system-wide) installation, both of which are included in the INSTALL notes document linked below.
If RPerl is properly installed, you should see a short text message displayed when you type the following command:
=for rperl X
    $ rperl -v
=for rperl X
On operating systems with less Perl support, you may have to perform a number of steps to successfully install RPerl, with dry technical detail available in the INSTALL notes document:
L
Unless you are an experienced programmer or system administrator, it is B recommended you use the Xubuntu operating system.  You can download the Xubuntu ISO file at the link below, then use it to create a bootable DVD disc or USB flash drive, install Xubuntu onto any computer, and issue the C<`sudo cpan RPerl`> command as described above.
L
If you are interested in viewing the source code of RPerl itself, you may find the latest major release of RPerl (stable) on CPAN:
L
You may find the latest development release of RPerl (possibly unstable) on Github:
L
=head2 Section 1.17: Where Is Perl Software Stored Online?
CPAN is the I<"Comprehensive Perl Archive Network">, the world's most successful and mature centralized software network.
CPAN servers are where most public Perl software is stored, including RPerl.
L
L
Several other programming language communities have copied the success and implementation of CPAN, including JSAN for Javascript, CRAN for R, and CCAN for C.
=head2 Section 1.18: How Can I Obtain Technical Support For RPerl?
Official RPerl technical support is provided through Auto-Parallel Technologies, Inc.
To request more information, please send an e-mail to the following address:
william DOT braswell AT autoparallel DOT com
=head2 Section 1.19: Are There Any Free Technical Support Options?
Free technical support for non-commercial users is provided by the RPerl community through Internet Relay Chat.
Server: irc.perl.org
Channel: #perl11
Easy Web Chat: L
=head2 Section 1.20: Are There Any Bugs In RPerl?
All software has small (or large) problems called I<"bugs">, and depending on who is marketing the software, they may even tell you some of the bugs are actually "features"!
RPerl is a work in progress, and may contain a number of bugs, both known and unknown.  If you find a bug in RPerl, we would love to hear about it!
The primary bug-tracking platform for RPerl is Github Issues, where you may file a new bug report ("new issue") if it is not already listed:
L
Please be sure to include all of the following information in your bug report:
=over
=item * Pertinent Problem Message Output, If Long Use L
=item * Operating System Version C<`cat /etc/issue`>
=item * Perl Version C<`perl -v`>
=item * RPerl Version C<`rperl -v`>
=back
Although Github Issues is strongly preferred, the RPerl development team also supports the legacy CPAN ticket system:
L
=head2 Section 1.21: How Can I Write A Program Using RPerl?
Computer programs are written in a human-readable format called I<"source code">.  Source code is stored as plain text data inside normal computer files.  These are the same kind of text files which you may be already familiar with as ending in the F<.txt> file suffix.  The only difference is we simply choose a different file name suffix to identify these specific text files as containing source code.  Thus, programs written using the RPerl language are plain text files, which means you can use any text editor to create and modify your RPerl source code.  Examples of common text editors include Notepad, Pico, and Vi.
L
To avoid possible file format problems, do not edit your RPerl programs using a word processor such as Wordpad, Word, OpenOffice, or LibreOffice.
Experienced RPerl developers may choose to utilize an I<"integrated development environment"> (IDE), which is a special text editor made for writing software.  Examples of common Perl IDE applications include Eclipse EPIC, Padre, and Komodo (non-free).
L
L
L
=head2 Section 1.22: A Sample RPerl Program
    #!/usr/bin/env perl
    
    # Foo Bar Arithmetic Example
    
    # [[[ HEADER ]]]
    use RPerl;
    use strict;
    use warnings;
    our $VERSION = 0.001_000;
    
    # [[[ CRITICS ]]]
    ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls)  # USER DEFAULT 1: allow numeric values & print operator
    ## no critic qw(RequireInterpolationOfMetachars)  # USER DEFAULT 2: allow single-quoted control characters & sigils
    
    # [[[ OPERATIONS ]]]
    my integer $foo = 21 + 12;
    my integer $bar = 23 * 42 * 2;
    my number  $baz = to_number($bar) / $foo;
    print 'have $foo = ', to_string($foo), "\n";
    print 'have $bar = ', to_string($bar), "\n";
    print 'have $baz = ', to_string($baz), "\n";
=head2 Section 1.23: What Are The Parts Of That Sample RPerl Program?
This program is separated by blank lines into 4 sections: shebang, header, critics, and operations.  
Other than the shebang and critics, all lines beginning with C<#> are comments and can be safely ignored or discarded without affecting the program.
The I<"shebang"> section is required, always contains exactly 1 line, and is short for I<"hash bang">; referring to the two leading characters C<#!> of this line.  The I<"octothorpe"> character C<#> (tic-tac-toe symbol) is called a I<"pound-sign"> when used on a telephone, and is called a I<"hash"> (or more recently and less accurately I<"hash-tag">) when used on a computer.  The exclamation-point character C is called a I<"bang"> when used on a computer.  When appearing together as the first two characters in a plain text file, the hash and bang characters tell the operating system to run the immediately-following command (in this case the Perl interpreter invoked by C) and pass the remaining contents of the text file as input to the command.  (Traditionally, the Perl interpreter has been located at F, however we must practice prudence by asking the operating system environment where our Perl interpreter is actually located, in order to support those cases where Perl may be installed in a non-standard directory, such as with Perlbrew or manually-built Perl interpreters.  Please see L for more information.)  In other words, if the first line of a plain text file is C<#!/usr/bin/env perl> (or C<#!/usr/bin/perl> or something similar), then that file is a Perl program.
The I<"header"> section is required and always contains 4 lines for an RPerl I<"program"> file ending in F<.pl>, or 5 lines for an RPerl I<"module"> ending in F<.pm> (covered later in Chapter 11).  C