develooper Front page | perl.beginners | Postings from February 2002

Writing file to Windows

Thread Next
From:
Daniel Falkenberg
Date:
February 25, 2002 14:56
Subject:
Writing file to Windows
Message ID:
3ACA70B144BD6D45B994CAC2CA4B9F98017CE8@opal.vintek.local
Hey All,

Is there any reason why I can't seem to get...

LWP::Simple::is_success(LWP::Simple::getstore($address, $html_file)

to write to a file.  I have used the exact same code on a Linux box but
when I go to run it on a Windows box it doesn't seem to download it and
save it to a dir?  Is this a permission problem? Is there something I am
missing here?

my $content = LWP::Simple::get($address);
$html_file = "foo.html";

if (LWP::Simple::mirror($address, $html_file) == RC_NOT_MODIFIED) {}
if (LWP::Simple::is_success(LWP::Simple::getstore($address,
$html_file))) {
  $p = HTML::TokeParser->new(shift||$html_file);
  if ($p->get_tag("h1")) {
  my $html_data= $p->get_trimmed_text;
  print $html_data;
}

Regards,

Dan

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About