Skip to content

Instantly share code, notes, and snippets.

@LadyAleena
Created March 7, 2015 06:15
Show Gist options
  • Save LadyAleena/9510521177d2ad6e881d to your computer and use it in GitHub Desktop.
Save LadyAleena/9510521177d2ad6e881d to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
# This is a script to show how to set a table for a formal dinner.
# The information came from various places on the internet.
# It may be inaccurate.
my @courses = qw(salad fish entree oyster dessert);
if (@courses > 3) {
my @last = splice(@courses,3,-1);
my @forks = map { "$_ fork" } @courses;
my @knives = map { "$_ knife" } reverse @courses;
my $last = grep { /oyster/ } @last ? 'oyster fork' : '';
print 'napkin '.join(' ',@forks).' plate '.join(' ',@knives).' spoon '.$last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment