Remove new line characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coco09
    New Member
    • Jan 2009
    • 1

    Remove new line characters

    Hi all

    I have the following line of text in my script

    $var = do {local $/; <$FILE>};#<-- slurp whole file in scalar

    The problem i am having is that the input file is a pcl file and has new line characters in the middle of a line. When the perl script is evaluating each line it meets this new line character and outputs it onto a new line which affects the final print.

    Can anyone tell me how to assign the text to the $var variable without evaluating the new line character?

    Thanks.
Working...