
Jasmine
Administrator
/ Moderator
Apr 5, 2000, 1:08 PM
Post #4 of 8
(2604 views)
|
Re: removing newline characters
[In reply to]
|
Can't Post
|
|
Did you try darian's code? If so, did you remove the close paren after the if($first) eq (a little booboo). Try this updated code below. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> open (CONFIG, "<config.dat") while (<CONFIG> ) { chomp; #gets rid of the newline ($first,$second) = split(/:/,$_); if($first eq 'target_url') { $target_url = $second; last; # no need to keep looping # unless you want the last # match of the file } } close (CONFIG); </pre><HR></BLOCKQUOTE> If it doesn't work, please post the actual datafile that you have and change the names to protect the innocent Here's what I'm thinking... the problem may be that the data in the datafile used backslashes instead of forward slashes in the url. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> whatever.com\newline.html whatever.com\formfeed.html whatever.com\rreturn.html </pre><HR></BLOCKQUOTE> Notice anything here?
|