The Greeter
#!/usr/bin/perl
# Author        : Jaime
# Date          : Mon Aug  6 21:38:27 UTC 2007
# Description   : The Greeter
 
use strict;
use warnings;
 
print "What's your name New Year's Eve Partier?\n";
my $name = <STDIN>;
chomp $name;
print "Happy New Year $name!\n"
 
__END__


Is that rude?
#!/usr/bin/perl
# Author        : Jaime
# Date          : Mon Aug  6 21:38:27 UTC 2007
# Description   : Is that rude?
 
use strict;
use warnings;
 
print "What year were you born in?\n";
my $year = <STDIN>;
chomp $year;
my $age = 2007 - $year;
print "You are $age years old\n"
 
__END__

RATIO

#!/usr/bin/perl
# Author        : Jaime
# Date          : Mon Aug  6 21:38:27 UTC 2007
# Description   : Ratio
 
use strict;
use warnings;
 
print "What's a number?\n";
my $number_1 = <STDIN>;
chomp $number_1;
 
print "What's another number?\n";
my $number_2 = <STDIN>;
chomp $number_2;
 
print "the ratio is ", $number_1/$number_2, "\n";
 
#OR DEFINE A RATIO VARIABLE AND USE THAT!
#my $ratio = $number_1/$number_2;
#print "the ratio for more typing is $ratio";
 
__END__

SUM AND MEAN
#!/usr/bin/perl
# Author        : Jaime
# Date          : Mon Aug  6 21:38:27 UTC 2007
# Description   : Ratio
 
use strict;
use warnings;
 
print "What's a number?\n";
my $number_1 = <STDIN>;
chomp $number_1;
 
print "What's another number?\n";
my $number_2 = <STDIN>;
chomp $number_2;
 
print "What's another number?\n";
my $number_3 = <STDIN>;
chomp $number_3;
 
print "What's another number?\n";
my $number_4 = <STDIN>;
chomp $number_4;
 
print "What's another number?\n";
my $number_5 = <STDIN>;
chomp $number_5;
 
my $sum = $number_1+$number_2+$number_3+$number_4+$number_5;
my $mean = $sum/5;
 
print "the sum is $sum\nand the mean is $mean\n";
 
__END__

THE ADVANCED VERSION

#!/usr/bin/perl
# Author : Jaime
# Date : Mon Aug 6 21:38:27 UTC 2007
# Description : Ratio
 
 use strict;
 use warnings;
 
 my $sum = 0;
 print "Type five numbers, after another, separated by newlines:\n";
 $sum = $sum+<STDIN>;
 $sum = $sum+<STDIN>;
 $sum = $sum+<STDIN>;
 $sum = $sum+<STDIN>;
 $sum = $sum+<STDIN>;
 
 my $mean = $sum/5;
 
 print "the sum is $sum\nand the mean is $mean\n";
 
__END__


Swap
#!/usr/bin/perl
# Author        : Venky Iyer
# Date          : Tue Jan  2 16:04:12 UTC 2007
# Description   : Swap
 
use strict;
use warnings;
 
print "Enter two numbers, separated by newlines:\n";
my $number_one = <STDIN>;
my $number_two = <STDIN>;
 
chomp $number_one;
chomp $number_two;
 
my $temp = $number_two;
$number_two = $number_one;
$number_one = $temp;
 
print "$number_one $number_two\n";
 
 
__END__