in reply to How to eliminate "/n" from text
By surrounding the input line with markers (the '>>' and '<<'), you will be able to see if there is a final \n causing you a problem. It may be that the first line of the file is blank, you know.my $file = './tcard.conf'; open(INFO, $file); my @lines = <INFO>; close(INFO); print("The first line is >>$lines[0]<<\n"); my $url = $lines[0];
If you haven't gotten a copy yet, go buy an Alpaca (Learning Perl by Schwartz (aka merlyn) and Phoenix). They develop a file reading code as an introduction to Perl; the section is titled "The chomp Operator", in chapter two.
----
I Go Back to Sleep, Now.
OGB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to eliminate "/n" from text
by Deib (Sexton) on Dec 30, 2004 at 00:08 UTC |