Stupid Perl/Apache Question
    Brian Chabot 
    brian at datasquire.net
       
    Thu Dec  7 16:32:18 EST 2006
    
    
  
Ben Scott wrote:
> On 12/7/06, Brian Chabot <brian at datasquire.net> wrote:
>> $auth = MIME::Base64::encode("$adminuser:$adminpass") || die "Error:
>> $!\n";
>> $mech->add_header (Authorization=>"Basic $auth") || die "Error: $!\n";
> 
>  You need to do this:
> 
> $mech->credentials ("username" => "password");
Well.. It didn't work, but we must have changed something... as the
error is identical.
That goes before $mech->get right?
...and from the docs, is it:
$mech->credentials ("username" => "password");
or
$mech->credentials ("username","password");
...or does it matter?
>  "Illegal seek"?  That's very strange.  Hmmmm... um, try the method
> above first.  Maybe we'll get lucky and that will work.  :)
No such luck...
>> The documentation for Mechanize could be a lot better.
> 
> http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize/Cookbook.pod
> 
> spells it out pretty clearly.
Not really.  (See above)
> The problem I had
> was getting decent diagnostics in the situation.  I ended up just
> calling out to "curl" to do the actual download.
If I had my way, I wouldn't need to use Mech at all.  I'd be accessing
the db directly and using PHP or just bash scripting with curl, too.
The job's requirements are where I need to scrape in perl...
Brian
    
    
More information about the gnhlug-discuss
mailing list