in reply to Re: DDJ Test for Perl
in thread DDJ Test for Perl

Question #41 is poorly worded. For example, in "add them to the end of each entry" what does the "them" refer to -- the values (the array elements) or newlines? I thought the former when I read it but the answer indicates the latter was the intent.

With that said I believe that English grammar rules would hint at removing the "that do not contain newlines" part of the sentence to determine what the "them" refers to.

In which case the correct answer would be #1.

Update: Massive rewrite and added spoiler tags.

Replies are listed 'Best First'.
Re^3: DDJ Test for Perl
by suaveant (Parson) on Aug 23, 2007 at 00:51 UTC
    I think that by "each" you have to assume array elements

                    - Ant
                    - Some of my best work - (1 2 3)

      Paraphrasing, there are two possible questions being asked:

      Given an array whose elements do not have any line feeds (or carriage returns, etc.):

      1. How do you print the entire array all on one line?
      2. How do you print each element of the array on a separate line?

      Based on the wording I think the question is actually asking the first question though the author thinks he is asking the second one.