CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Reading html from another file causes problems

 



supaafly
stranger

Jul 22, 2001, 1:04 AM

Post #1 of 4 (638 views)
Reading html from another file causes problems Can't Post

I am working on a script, and i have my script reading html from an external file, but for some reason when i access the file, and it prints the html, it adds a <BR> to every line, and causes alot of space, and it doesnt look right. Please help me on this. I am not sure what is wrong.

----------
Supaafly```


Pro_4
User

Jul 22, 2001, 7:16 AM

Post #2 of 4 (631 views)
Re: Reading html from another file causes problems [In reply to] Can't Post

I think your problem( Marcus can explain this good) is when sending html files from windows to unix there is a change in setup of way files are. If you download the file back onto your comp you should see a lot of black squares. The easiest way to get rid of this is to use a regex that takes out all newline and return characters(the things that are messing with your file).

Code
$html =~ s/\r?\n//g; 
# $html is the html code that you took out of a file.

That should do it, otherwise i am just completely lost.


Hope that helps :)

@letters = ('A'..'Z', 'a'..'z', '1'..'5', '_');
@i = ( '15', '43', '40');
print @letters [ @i, -1, 55];


supaafly
stranger

Jul 22, 2001, 8:23 PM

Post #3 of 4 (624 views)
Re: Reading html from another file causes problems [In reply to] Can't Post

Thanks, but i downloaded the file to my hard drive, but i do not see any black squares, so i dont know...

----------
Supaafly```


Janie
stranger

Jul 22, 2001, 11:38 PM

Post #4 of 4 (620 views)
Re: Reading html from another file causes problems [In reply to] Can't Post

Hi supaafly. If you post samples of data, code and the output you're getting, you'll probably get a very quick answer on this.

Janie.
map{$,--%(5>>1)^0?push@y,$_:unshift@y,$_}sort(another=>Hacker=>Just=>Perl);for(1&1=>1|0){push@y,shift@y}print"@y"


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives