This question was part of a job interview. There were 4 questions and it asked you to answer 3 of them. I answered the other 3 because I did not understand what this was supposed to be. Could some explain WHAT they are asking for?

================================================================ #!/usr/local/bin/perl use strict; # read standard input. print a "hexdump" to standard output # use the +following sample output format: # 00000000: 7F454C46 01010100 00000000 00000000 .ELF............ # 00000010: 02000300 01000000 14860408 34000000 ............4... # 00000020: 1C0E0000 00000000 34002000 06002800 ........4. ...(. # 00000030: 19001600 06000000 34000000 34800408 ........4...4...

I would guess the part I don't understand is the output format. I know how to convert characters from STDIN to hex, there are plenty of places that tell you how to do that. But looking at the output is confusing. I guess I don't know enough about hex dumps...


In reply to What is this question asking? by Herkum

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.