www.perl.com
Perl Programming
List Operators
  • split
    • Splits a string into a list of substrings
    • Removes a delimiting string or regular expression match
  • join
    • Joins a list of substrings into a single string
    • Adds a delimiting string

        my @animals = qw(dog cat fish parrot hamster);
        my $string = join(" and a ", @animals);
        print "I have a $string.\n";

        my $sentence = "The quick brown fox...";
        my @words = split(" ", $sentence);
      

        I have a dog and a cat and a fish and a parrot and a hamster.
      
http://stuff.mit.edu/iap/perl/