my @x = qw /one two three four five six/; #declare and assign the array
    #see below for a full explanation of qw
my @z = grep /e/, @x;  #select those elements that contain an e
    #grep has used the Regular Expression /e/ and applied it 
    # to @x to generate a new list, being those elements containing
    # an e, so the new list is: one, three, five.
    #
    #grep also allows the ! modifier, so
my @z1 = grep !/e/,@x; #will return two, four, six - elements with no e
