in reply to How to eliminate "/n" from text

As osunderdog noted, chomp is the way to go, it your guess is correct. However, it might be a bit more useful to know rather than guess.
my $file = './tcard.conf'; open(INFO, $file); my @lines = <INFO>; close(INFO); print("The first line is >>$lines[0]<<\n"); my $url = $lines[0];
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.

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
    I see.
    The final \n was the problem alright, but I'll keep the ('>>' and '<<') in mind from now on.
    And I'll start looking for that Alpaca soon.
    Thanks a lot for the info :)