title: sprintf format and print inconsistencies whilst creating fixed width column
body: <p>(I have already cross posted onto another site and will update either with the solution but so far struggling with an answer)</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <blockquote>
          <blockquote>
            <blockquote>
              <p>19th Dec 2013 7:06pm PT --- I found the solution and I updated below.</p>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>I am outputting two items of data per line. The first column of data is not fixed length, and I want the second item of data to be correctly aligned in the same position each time so I am using sprintf to format the data and then mail out the data</p>
  
  <p>The print command output illustrates that the data is formatted correctly.</p>
  
  <p>Yet, when the output in my email is different, the alignment is all wrong.</p>
  
  <p>I initially thought it was the mailer (MIME::Lite) program but I am not sure it is.  </p>
  
  <p>Reason why I think that is because I using eclipse Perl environment, when I look at the debug variable list, I see that the strings are padded out exactly like the output in my email, yet the print statement shows the data correctly aligned!!!</p>
  
  <p>Please help me understand what is going on here and how to fix it.</p>
  
  <pre><code>use MIME::Lite;
  $smtp = "mailserver";
  $internal_email_address = 'myemailaddess';
  $a = sprintf ("%-60s %-s\n", "the amount for Apple is ","34");
  $b = sprintf ("%-60s %-s\n", "the amount for Lemons is", "7");
  print $a;
  print $b;
  $c = $a.$b;
  mailer( $internal_email_address,"issue", $c);
  
  sub mailer {
      my ( $addr, $subj, $output ) = @_;
  
      print "$_\n" for $addr;
      print "$_\n" for $subj;
      print "$_\n" for $output;
  
      $msg = MIME::Lite-&gt;new(
          From    =&gt; 'xxxx',
          To      =&gt; $addr,
          Subject =&gt; $subj,
          Data    =&gt; $output
      );
  
      MIME::Lite-&gt;send( 'smtp', $smtp, Timeout =&gt; 60 );
      eval { $msg-&gt;send };
      $mailerror = "Status: ERROR email - MIME::Lite-&gt;send failed: $@\n" if $@;
      if ( $mailerror eq '' ) {
          $status = "Status: Mail sent\n";
      }
      else {
          $status = $mailerror;
      }
  }
  </code></pre>