P05 - Reverse a list

Author: Scott Penrose

Specification:

P05 - Reverse a list

Source code: P05-scottp.pl

use v6;

# a. One line example
#       <> used to create an array
#       .reverse on the object to reverse the order
#       .join called to present the data with a " "
#       say displays the result
say .list.reverse.join(' ');

# b. Perl representation
#       .perl serialises the data as perl representation (like Data::Dumper in perl5)
#       .say to display the result (print with a new line)
.list.reverse.perl.say;