#!/usr/bin/perl -w

#### Program:
print "Officialay Indenberghay Ystemssay Igpay Atinlay Ordway Anslatortray\n\n";
$end = "ay";

for (;;) {
    print "Easeplay enteray aay inglesay Englishay ordway: ";
    $english = <STDIN>; 
    chomp($english);

    if    ( $english eq "" )                                { last;                       }    
    elsif ( $english =~ /^([bcdfghjklmnpqrstvwxyz]+)(.*)/ ) { $piglatin = "$2$1$end";     }
    else                                                    { $piglatin = "$english$end"; }
    
    print "                                    --> $piglatin\n";  
}             
__END__

#### Sample Dialogue:
Officialay Indenberghay Ystemssay Igpay Atinlay Ordway Anslatortray

Easeplay enteray aay inglesay Englishay ordway: pig
                                    --> igpay
Easeplay enteray aay inglesay Englishay ordway: truck
                                    --> ucktray

#### Notes on Code Fragments:


                    
if    ( ... ) { ... }
elsif ( ... ) { ... }
else          { ... }
    ( ... )         # is a conditional
                    # the first conditional that's true, 
                    #   causes the corresponding { ... } to execute
    else            # if reached, its { ... } will execute

$x =~ / ... /       # 
    ^               # matches start of line
    [ ... ]         # matches any of the ... characters
    +               # one or more of the preceding character

    $1              # equals whatever was matched by the pattern
                    #   enclosed by the first set of parentheses

############################# at'sthay allay olksfay #################################
                                   
