colonelcrayon has asked for the wisdom of the Perl Monks concerning the following question:
This actually works fairly well for english, but when I try it with my history grade it doesn't work at all. If I open history.txt, it shows all the information from the web page. Yet with a simple test in perl...#!/usr/bin/perl -w use LWP::Simple; use HTML::Obliterate qw(extirpate_html); $url="where my grades are.html"; $mypage=get($url); my $q=extirpate_html( $mypage ); open OUT, ">/home/jesse/Desktop/grades/history.txt"; select OUT; print $q; close OUT; open(GRADE, "/home/jesse/Desktop/grades/history.txt"); $. = 0; do { $history = <GRADE> } until $. == 32 || eof; #32 is the line with + my grade print $history close(GRADE);
...I see that only a garbled bit of the information is really saved as $y. How can I read the whole thing if only part is saved? Is this information not really there?#!/usr/bin/perl -w use LWP::Simple; use HTML::Obliterate qw(extirpate_html); $url="where my grades are.html"; $mypage=get($url); my $y=extirpate_html( $mypage ); print $y;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl doesn't read whole file
by shmem (Chancellor) on Dec 02, 2007 at 22:59 UTC | |
by ikegami (Patriarch) on Dec 03, 2007 at 00:42 UTC | |
by colonelcrayon (Novice) on Dec 02, 2007 at 23:28 UTC | |
by shmem (Chancellor) on Dec 02, 2007 at 23:31 UTC | |
by colonelcrayon (Novice) on Dec 02, 2007 at 23:56 UTC | |
|
Re: Perl doesn't read whole file
by KurtSchwind (Chaplain) on Dec 02, 2007 at 23:04 UTC | |
by colonelcrayon (Novice) on Dec 02, 2007 at 23:47 UTC | |
by shmem (Chancellor) on Dec 03, 2007 at 00:08 UTC | |
by colonelcrayon (Novice) on Dec 03, 2007 at 00:17 UTC | |
by GrandFather (Saint) on Dec 03, 2007 at 00:12 UTC | |
by colonelcrayon (Novice) on Dec 03, 2007 at 00:21 UTC |