in reply to linux file creation

The file (testimage.gif) may not have been created in the directory you expected. Are you sure the working directory is what you think it is? Perhaps the file exists happily elsewhere. (You could avoid this question by specifying a full path rather than only a filename.)

Secondly, you may be interested in LWP::Simple's getstore() method. It is very similar to what you're using now (in fact, it's a wrapper over LWP::UserAgent), but you may find it easier to use.

Replies are listed 'Best First'.
Re^2: linux file creation
by Anonymous Monk on Jun 01, 2007 at 05:17 UTC
    Thanks for the suggestions. I am not sure how to determine the working directory. I tried using pwd when in the directory where script reside to get the full path and added that to the file name. This still did not work. My guess is that due to my lack of Linux experience I am missing something simple. Here is my altered script. Any suggestions would be greatly appreciated.
    #!/usr/bin/perl # Create a user agent object use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $url = 'http://www.nwweather.com/images/realwind-animate1.gif'; my $response = $ua->get($url, ':content_file' => '/kunden/homepages/ +40/d176746031/htdocs/NWWX/CamScripts/testimage.gif'); # Pass request to the user agent and get a response back # Check the outcome of the response if ($response->is_success) { print $url; } else { print $response->status_line, "\n"; }