in reply to Concatenation appends to front of variable

$cal_name has a trailing Carriage Return (i.e. $cal_name eq "BCPFTPCL\x0D"), so $var1 ends up being "BCPFTPCL\x0D.cal".

Replies are listed 'Best First'.
Re^2: Concatenation appends to front of variable
by herda05 (Acolyte) on May 29, 2009 at 20:59 UTC
    Ahh, thank you. I had tried chomp to no avail earlier and never pressed beyond that when it didn't work.
    Chop solved my problem!
    Dan H.
      s/\s+$//; will get rid of trailing LF, CR or CRLF (and any trailing space and tabs) safely.

      Avoid chop. It is a rather blunt tool and will cause wailing and gnashing of teeth. If chomp didn't do the job then most likely the line ends are not what you think they are. Are you processing Windows generated files on a *nix box perchance?


      True laziness is hard work