Help for this page

Select Code to Download


  1. or download this
    # declare a subroutine
    # takes two strings as arguments
    ...
        # newlines are removed from each element of the array
        chomp @{$a_ref};
    }
    
  2. or download this
    my($ref) = \@array;
    my($file) = '/usr/dict/words';
    ...
    # $ref now contains a reference to an array which contains
    # all the words in /usr/dict/words, with the newlines
    # removed.