Variables
Basic List Functions

  • Another way to add or remove elements from a list is by using one of Perl's four built-in list manipulation functions

      @foo = ( "a", "b", "c", "d" );

  • Add "e" to the END of @foo

      push( @foo, "e" );

  • Remove "e" from the END of @foo

      $e = pop( @foo );

  • Add "a" to the START of @foo

      unshift( @foo, "a" );

  • Remove "a" from the START of @foo

      $a = shift( @foo );