Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: What does this print for you?

by JadeNB (Chaplain)
on Dec 24, 2009 at 22:57 UTC ( [id://814302]=note: print w/replies, xml ) Need Help??


in reply to What does this print for you?

I'm no pack expert, but I do happen to have otherwise-identical installs of perl (version 5.8.9) from MacPorts on a 32-bit PPC running Mac OS X.4.10, and a 64-bit Intel machine running Mac OS X.5.8:
$ perl -e'print pack q/d*/,(1.7453026326120991e+194,1.5156845462257262 +e-147)' hC yrreM!samtsir
(on the 32-bit machine) and
$ perl -e'print pack q/d*/,(1.7453026326120991e+194,1.5156845462257262 +e-147)' Merry Christmas!
(on the 64-bit machine). I'm not seeing a spurious ‘K’ or ‘t’, but I am seeing an unexpected reversal—and, hey, the PPC uses a different endian-ness from the Intel ….

Replies are listed 'Best First'.
Re^2: What does this print for you?
by kikuchiyo (Hermit) on Dec 24, 2009 at 23:30 UTC
    I can see where the reversal comes from, if the PPC indeed runs in an opposite* endian mode from the Intel.

    However, I understand even less where the difference mentioned in the OP comes from.
    On my 32 bit Vista virtual machine it prints "Kerry Cthistmas!", but windows users in this thread reported that their windows perl prints the correct message.

    Perhaps the perl compile-time flags give a clue into this mistery?
    The 64 bit Ubuntu 9.10, perl 5.10.0 version:
    MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API

    The 32 bit Vista perl 5.10.0 (Camelbox build) version:
    MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO

    * I always found this endian business a horrible mess - especially that there are certain combinations of CPUs, OSes and compilers where mixed endianness occurs.

      The I-guess relevant portion of the output of perl -V is

      hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef
      on the 64-bit machine. I'll edit this comment from my 32-bit machine in a few minutes.

      UPDATE: Here's the same passage from my 32-bit machine:

      hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef
      but maybe it's this bit that's more interesting:
      Compile-time options: PERL_MALLOC_WRAP USE_FAST_STDIO USE_LARGE_FILE +S USE_PERLIO

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://814302]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found