Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

ikegami,

With all due respect, the topic is not about Perl's definition of byteorder, but the definition of and examples for little-endian and big-endian in the on-line documentation for Perl's 'pack' function. Perl's byteorder is academic! Please see the following from a RS/6000 with AIX 5.2 operating system:

    pyrperl -v

    This is perl 5, version 12, subversion 2 (v5.12.2) built for aix Copyright 1987-2010, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
and

    pyrperl -V:byteorder
    byteorder='4321';

and

    pyrperl -e '$p=pack("N",16909060); print unpack("H8",$p),"\n";'
    01020304
Until now, I did not know that the RS/6000 has a software switch on the motherboard to indicate running in little-endian or big-endian. When I read the Camel book, and it said that the "N" parameter of 'pack' put the result in Network or big-endian format, I knew what that meant and it didn't have an example. My original problem was with the on-line documentation.

In goggling this, many authors seem to be guessing!

Regards...Ed

"Well done is better than well said." - Benjamin Franklin


In reply to Re^3: Is the documentation for Perl 5.20 'pack' correct? by flexvault
in thread Is the documentation for Perl 5.20 'pack' correct? by flexvault

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found