NAME

Question types


Start with


Question limit

of 29 available terms

Print test

29 True/False questions

  1. Perl is an interpreted scripting language, with C-like syntaxTrue

          

  2. Consider the following statement: @words = split/\s+/, $x; This statement examines $x and creates array @words by splitting string $x on the following delimiter: (Mark ALL that are true)a single space
    multiple whitespace characters
    This instance of split uses /\s+/ as the delimiter, which is interpreted to mean one or more whitespace characters.

          

  3. In Perl replacement strings, groupings matched in the search expression may be referred to by matching variables $1, $2, $3, etc.True A class is a type of character, such as alphabetic (a-z, A-Z), numeric (0-9) and white space (tab, space and newline)

          

  4. Perl regular expressions .* (dot star) and .+ (dot plus) will never match more than one character.True

          

  5. True or false: if "foobar" =~ /(foo|bar|baz)/True

    (foo|bar|baz) will match any of the words foo, bar or baz.

          

  6. Perl is not case sensitive.False

          

  7. if "foobar" =~ /^bar/ isFalse
    ^bar means find the string "bar" at the beginning of the string being searched.

          

  8. s/^$/ matches:an empty line

          

  9. Which of these regular expressions matches the entire string "bar"?three or more of the preceding object

          

  10. After executing the following Perl statements, what variable will contain only the string "test"?

    $x = "this is a test";
    @words = split/\s+/, $x;
    $words[3]

          

  11. After executing the Perl statements, what will $string contain?
    $string = "Cowan, Ted";
    $string =~ s/d/ddy/;
    Cowan, Teddy

          

  12. Perl scalar variables are defined and named with a $ (dollar sign).False

    Comments begin with a # (hash mark)

          

  13. Using regular expressions, strings can be matched by class, such as alphabetic, numeric and whitespace characters.True A class is a type of character, such as alphabetic (a-z, A-Z), numeric (0-9) and white space (tab, space and newline)

          

  14. In Perl regular expressions, groupings are created by enclosing part of the regular expression in parentheses ().True A class is a type of character, such as alphabetic (a-z, A-Z), numeric (0-9) and white space (tab, space and newline)

          

  15. Perl will pass the entire replacement string to the expression evaluator if an "e" is appended to the s/// search operator as in this example:
    $z = "count to 3, no more, no less"; $z =~ s/(\d+)/$1 * $1/e;
    /bar/
    /bar/:

          

  16. Perl can be hard to read.False

          

  17. Comments in Perl begin with a : (colon).True

          

  18. The statement "s/foo/bar/g" will replace only the first "foo" with "bar" in the string being searched.False
    ^bar means find the string "bar" at the beginning of the string being searched.

          

  19. split is a Perl function that returns an array of values by splitting a string based on a given delimiterTrue

          

  20. What is a regular expression?A syntax for searching and replacing strings in Perl. Regular expressions are a means of searching strings of text, a prominent feature of Perl.

          

  21. After executing the following, what will $y contain? $y = "Mickey Mouse"; $y =~ s/^(.)\s+(.)$/$2, $1/;"Mouse, Mickey"
    the expression s/^(.)\s+(.)$/$2, $1/; groups two words separated by whitespace and reverses those words with a comma and space between them.

          

  22. Perl hash or associative arrays are defined and named with a % (percent sign).False

    Comments begin with a # (hash mark)

          

  23. Regular expressions can be very difficult at times to debug.three or more of the preceding object

          

  24. s/// is the Substitution Operator in PerlFalse

          

  25. Perl was created by Larry Wall to assist him in his system admin duties.False

          

  26. Perl array variables are defined and named with an @ (at sign).False

    Comments begin with a # (hash mark)

          

  27. Strings in Perl can be delimited with either single or double quotes but single quotes prevent interpolation.False

    Comments begin with a # (hash mark)

          

  28. Perl is freely available on virtually every platform.True

          

  29. The regular expression {3,} matchesthree or more of the preceding object