#!/usr/bin/perl
# w2.9.pl  removing elements from a list

@list = ("Betty", "Cathy","Don","Eve", "Fred","George", "Harry");
$sub = @list[3];
@slice = @list[2..4];
$last = pop(@list);
$first = shift(@list);
@r = reverse (@list);

print ("$first is first; $last is last; $sub is in the middle\n");
print ("Here is a slice: @slice\n");
print ("Here is the remainder: @list\n");
print ("Here it is backwards: @r\n");
__END__

