I get mangled output with first printf but the second printf below works. Notice that I put the phone number last in the second one? Based on tests, if I print anything after the phone number it results in corruption.
printf "Dialing %s of %s on %s: %s, %s, %s\n", $index, $total, $ref->{'datetime'}, $ref->{'host'}, $ref->{'pho +ne'}, $ref->{'description'}; printf "Dialing %s of %s on %s: %s, %s, %s\n", $index, $total, $ref->{'datetime'}, $ref->{'description'}, $ref +->{'host'}, $ref->{'phone'};
Output (mangled first) looks like:
, UK Routersf 16 on Fri Jan  4 18:44:40 2002: UK9Z, 011441234567890
Dialing 01 of 16 on Fri Jan  4 18:41:03 2002: UK Routers, UK9Z, 011441234567890
I even tried print "RJL:/$ref->{'phone'}\n"; with similar mangled results.

The phone number above was altered, but the real number does start with 01144. I also printed the phone number using %#vx and did not see any "hidden" special characters.

I am using the perl listed below on an Ultra-10 running Solaris 8 with Maintenance Update 6.

This is perl, v5.6.1 built for sun4-solaris-thread-multi
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 630 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 23:31:40 Oct 31 2001
Any ideas what is happening? If I was going to guess the phone number is being treated as an Octal number. If so, why would it in this context (or how can I escape it)? And why does it still print correctly (shouldn't I see 44... instead)? -- Argel

Edit kudra, 2002-01-10 Replaced some pre with code


In reply to Mangled print output -- any ideas why? by Argel

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.