On Monday 22 May 2006 14:49, [EMAIL PROTECTED] wrote:
> When I execute the script below, I get the error message "No such file or
> directory at simple2.pl line 21."  Line 21 is the Open OUT statement.
> This script parallels a tutorial script that does work and I don't see the
> error.  It does print to the screen if I comment out the Open OUT line.
> Thanks in advance.
>
> #!/bin/perl
>
> use strict;
>
> use WWW::Mechanize;
>
> my $output_dir = "c:/training/bc";
>
> my $starting_url = "http://clerk.house.gov/members/olmbr.html";;
>
> my $browser = WWW::Mechanize->new();
>
> $browser->get( $starting_url );
>
>
> $browser->submit();
>
>
> {
>
> open OUT, ">output_dir/simple2.html" or die "Can't open file: $!";

Maybe the directory 'output_dir' does not exists.  perl wont create 
directories unless you tell it to by using the mkdir function.

>
> print OUT $browser->content;
>
> close OUT;
>
> }
>
> close PAGE;
>
> print $browser->content;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to