colonelcrayon has asked for the wisdom of the Perl Monks concerning the following question:
This should print the lines describing the last 24 hours of activity - but doesn't. The part which downloads the info and pastes it in a text file works flawlessly. It's clearly the search portion which doesn't work. Any ideas about what's going on?#!/usr/bin/perl use LWP::Simple; use HTML::Obliterate qw(extirpate_html); $url="http://volcano.wr.usgs.gov/hvostatus.php"; $mypage=get($url); my $q=extirpate_html( $mypage ); open OUT, ">/home/jesse/Desktop/Programs/vol.txt" or die $!; select OUT; print $q; close OUT; open IN, "</home/jesse/Desktop/Programs/ups.txt" or die $!; select IN; foreach $line (<IN>) { if ($line =~ /^Last 24 hours/) { print $line; } } close IN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Basic search question
by CountZero (Bishop) on Jan 06, 2008 at 22:08 UTC | |
by colonelcrayon (Novice) on Jan 07, 2008 at 00:59 UTC | |
|
Re: Basic search question
by Corion (Patriarch) on Jan 06, 2008 at 20:40 UTC | |
by ForgotPasswordAgain (Vicar) on Jan 06, 2008 at 20:59 UTC | |
by colonelcrayon (Novice) on Jan 07, 2008 at 01:01 UTC | |
|
Re: Basic search question
by hipowls (Curate) on Jan 06, 2008 at 22:02 UTC | |
by colonelcrayon (Novice) on Jan 07, 2008 at 00:56 UTC |