By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,542 Members | 1,434 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,542 IT Pros & Developers. It's quick & easy.

Remove new line characters

P: 1
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.
Jan 16 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.