Summary: you're using h and l incorrectly

Thanks for the info. But to be clear, I was exploring l, h, etc. exploratively and unfortunately only showed a floating point example. The exact same differences (between 5.6.1 and 5.8.0) show up when used for integer conversions.

# file: printf.pl printf "%4.4f\n", 1; printf "%4.4lf\n", 1; printf "%4.4hf\n", 1; printf "%4.4qf\n", 1; printf "%4.4Lf\n", 1; printf "%4.4llf\n", 1; #outputs: $ /usr/bin/perl printf.pl 1.0000 1.0000 1.0000 %4.4qf %4.4Lf %4.4llf $ /usr/local/bin/perl printf.pl 1.0000 %4.4lf %4.4hf %4.4qf 1.0000 1.0000

Where /usr/bin/perl is 5.6.1 and /usr/local/bin/perl is 5.8.0 with the same compile flags (other than ithreads as previously mentioned) and the same version of gcc under linux. It was an integer conversion usage in Damian's Text::Reformat module that brought this to light. Something funny is definitely going on.


In reply to Re: Re: printf size flag incompatibility by Anonymous Monk
in thread printf size flag incompatibility by Anonymous Monk

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.