Well, I made a wild stab in the dark and though you might have a control character at 
the end of something.

When I run this code(note the \r at the end of rname):
$ltr = "LETTER";
$rname = "MICROFILM\r";
$numltrs = 4;
$rdate = "30May01";
$pdate = "31May01";
$cntr=1;
$new_fn="$ltr.$rname.$numltrs.$rdate.$pdate.$cntr";
print "new_fn=$new_fn";

I get this as the result:
.4.30May01.31May01.1ILM

The results aren't identical but close enough to assume there is a control code in 
there somehwere.

If you're reading this input from a file maybe try using a chomp?

Hope this helps!
Ken

  ----- Original Message ----- 
  From: Gary Luther 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, May 31, 2001 12:00 PM
  Subject: Printing has me confused


  I am writing a program and am being baffled by what is happening.  Here is a section 
of the debug session:

    DB<1>
  main::(/common/bin/whaduname.LTR:98):
  98:             $new_fn="$ltr.$rname.$numltrs.$rdate.$pdate.$cntr";
    DB<1>
  main::(/common/bin/whaduname.LTR:99):
  99:             print "New FN = $new_fn\n";
    DB<1> print $new_fn
  .4.30May01.31May01.1  <==== notice that $ltr and $rname are not present
    DB<2> print $ltr  <=== $ltr has a value
  LETTER
    DB<3> print $rname <== $rname has a value
  MCROFILM
    DB<4> print $numltrs
  4
    DB<5> print $rdate
  30May01
    DB<6> print $pdate
  31May01
    DB<7> print $cntr
  1
    DB<8> n
  .4.30May01.31May01.1FILM <== where did the FILM come from?? I dont work for Kodak!
  main::(/common/bin/whaduname.LTR:102):
  102:            $last_old_name = $old_name;

  Am I losing my mind??   Here is what I expect in $new_fn ==> 
LETTER.MCROFILM.4.30May01.31May01.1
   
  TIA

  --
  -------------------------------------------------------------------------
  "They that can give up essential liberty 
     to obtain a little temporary safety 
     deserve neither liberty  nor safety."                      

  -- Benjamin Franklin 
  -------------------------------------------------------------------------
  RRRRR                Gary Luther
  RR  RR               SAF
  RR  RR UTABEGAS      2500 Broadway
  RR RR                Helena, MT 59602
  RRRR                 [EMAIL PROTECTED]
  RR RR  ULE !!        
  RR  RR               Visit our website at
  RR   RR              http://www.safmt.org

Reply via email to