nerdexam
EC-Council

312-92 · Question #79

What is the following PERL script trying to accomplish? sub mycode_string { join("" map('$_ > 255 ? sprintf("\\x{%04x]", $_) : chr($_) = ~ /[[:cntrl:]]/ ? sprintf(\\x%02X", $_) : chr($_) }…

The correct answer is D. Display Unicode as text. See the full explanation below for the reasoning.

Question

What is the following PERL script trying to accomplish? sub mycode_string { join("" map('$_ > 255 ? sprintf("\x{%04x]", $_) :

chr($) = ~ /[[:cntrl:]]/ ? sprintf(\x%02X", $) :

chr($) } unpack("u*", $[0]))l }

Options

  • AConvert hexadecimal to Unicode
  • BDisplay test as Unicode
  • CConvert hexadecimal to text
  • DDisplay Unicode as text

How the community answered

(18 responses)
  • A
    17% (3)
  • B
    6% (1)
  • C
    6% (1)
  • D
    72% (13)

Community Discussion

No community discussion yet for this question.

Full 312-92 Practice