#!/usr/bin/perl
# A simple Perl program to print out a little message.

# The letters that are going to be used in the message written
# in the form of a silly phrase.  In Perl single variables start
# with '$'. The last 'h' is not used.
#          0123456789
$phrase = "punchy fish";         

# This number is the order that the letters will be used from the 
# the phrase above, counting starting from 0. So the number '2'
# stands for the letter 'n', etc.
$number = "04598396896712";

# The split command change the Perl variable $string into the
# Perl array (starts with @) @split_phrase.  This leads to an
# arraywhere each element is one character long.
@split_phrase = split //, $phrase;

#  The split command works the same way here.  It leads to @split_number
#  having each digit of $number as a separate element in the array.
@split_number =  split / */, $number;

#  This prints out the coded message.  Since Perl arrays default
#  printing out with spaces between the elements, we combine the
#  array back down to a string with the join function. The
#   @split_phrase[@split_number] causes the string to print
#  out each letter from @split_phrase that corresponds to each string
#  in $split_number.  The \n at the end causes a newline.
print ((join '', @split_phrase[@split_number]) . "!\n");

# Run it yourself to see the phrase.
