in reply to Re: Pulling HTML from a remote site and writing a portion of it to a file on server
in thread Pulling HTML from a remote site and writing a portion of it to a file on server

This is running on Unix. It is a script that is called from a cron job.Here is an updated script. Can you offer some help? Nothing is writtten to the file.
#!/usr/bin/perl use strict; use LWP::Simple; use LWP::UserAgent; my $data = get("http://www.cyrusoilandgas.com"); my ($wanted) = $data =~ /<!---------------PETROLEUM----------------->\ +s*(.*)\s*<map name="BbgELogin2">/s; open (FH,"./file.txt") ||die"$!"; print FH $data; close FH;
  • Comment on Re: Re: Pulling HTML from a remote site and writing a portion of it to a file on server
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Pulling HTML from a remote site and writing a portion of it to a file on server
by bikeNomad (Priest) on Jun 23, 2001 at 22:45 UTC
    This is because of your open. Try:
    open(FH, ">file.txt") || die "$!\n";

    BTW, didn't you post your node twice?

(jeffa) 3Re: Pulling HTML from a remote site and writing a portion of it to a file on server
by jeffa (Bishop) on Jun 23, 2001 at 22:46 UTC