...and a couple other ways, but always the same result happens. I still get a variable value with some sort of carriage return added to the value. How do I remove the carraige return/new line from the value?
BTW "n" and "r" in the program commands should be "back slash + n" and "back slash + r".
[ Message was edited by: JimBot 07/28/2005 06:47 am ... Reason: Fixed Title and Code. ]
That doesn't make the variable $data2[$a] contain a value without a carraige return. It didn't seem to do anything. Perhaps it was not used in the right place. What does that command do anyway?
While I ended up using another method, your method helped me find a very similar method:
chop(@data2);
Running it through that command 2 times removed all the new line characters. It seems that when I upload my flat file text database from my computer to my linux server, it interprets the single carraige return as a double carraige return. Weird. Anyways "chop" does the trick. Thanks for leading me to a successful method.
Good that you sorted the problem Curt. Sorry I am a little late in answering this topic.
'Chop' would strip the last character no matter what while chomp() will strip the newline alone. When you deal with binary files make sure that you set $/ explicitly to the appropriate value for your file format before using chomp().
You will find more information on Perl usage across different OS here: [link]
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
You have not yet logged in, or registered properly as a member
You are a member, but no longer have posting rights.
This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.