LWP::Simple - Terminal won't but BBEdit will.

2006-07-09 Thread Andrew Brosnan
Hi,

I came across something odd editing a script with BBEdit. The BBEdit #!
menu has a 'Run' command and a 'Run in Terminal' command. The script
below works fine when I use the Run command, but returns HTTP response
code 500 when I use Run in Terminal. I tried running it directly from
Terminal and I get the same result, HTTP response code 500.

I also noticed that getstore() returns 500 as a one-liner from Terminal
(but getprint() works fine). What gives?

Regards,
Andrew


#!/usr/bin/perl

use warnings;

use strict;

use LWP::Simple;

my $url = 'http://www.google.com';

my $file = 'Users/andrewbr/Desktop/google.html';

my $res = getstore($url, $file)
or die Couldn't get/store $url;

print $res;




Re: LWP::Simple - Terminal won't but BBEdit will.

2006-07-09 Thread Andrew Brosnan
On 7/9/06 at 6:03 PM, [EMAIL PROTECTED] (Sherm Pendley) wrote:

 On Jul 9, 2006, at 5:03 PM, Andrew Brosnan wrote:
  
  my $file = 'Users/andrewbr/Desktop/google.html';

 Easy fix - add a / to the beginning of $file to make it a fully- 
 qualified path.

Ahh, that was a typo...thanks for proofreading me! :-) I thought I was
loosing it.

Andrew