#!/usr/bin/perl -w
# Push_shift
#    VERSION: 1 (13 September 2003)
#    PURPOSE: Illustration of push, pop, shift, unshift
#    INPUT FILES:  None
#    OUTPUT FILES: None. Output to monitor.

############## LIBRARIES AND PRAGMAS ################
  use strict;

#################### CONSTANTS ######################

   my $LF = "\n";                    # Line feed

#################### VARIABLES ######################

   my @protein;        # Array storing names of proteins
   my $name1;          # Name of protein popped from @protein
   my $name2;          # Name of protein shifted from @protein
   my $name3;          # Name of 2nd protein shifted from @protein

################### MAIN PROGRAM ####################

   @protein = ("cytochrome oxidase","hexokinase","glutamine synthetase");
   push @protein, "phosphofructokinase", "albumin";
   $protein[1] = "deleted";
   unshift @protein, "globin";
   $name1 = pop @protein;
   $name2 = shift @protein;
   $name3 = shift @protein;
   print "name1 = $name1  name2 = $name2  name3 = $name3", $LF;
   print "current protein[2] = $protein[2]", $LF;
   print "remaining names: ", join(", ", @protein);
