I am trying to get a file from a remote server.
I have got this code from CPAN for the Get() command which seems to be the right thing but, it just locks up.
I have changed the domain name for security but the file name I used was pasted from the address bar so is correct.
I also tried an incorrect filename and the script refused to die.
The same problem if I remove the print statements.
Am I missing something obvious here?
Keith
I have got this code from CPAN for the Get() command which seems to be the right thing but, it just locks up.
I have changed the domain name for security but the file name I used was pasted from the address bar so is correct.
I also tried an incorrect filename and the script refused to die.
The same problem if I remove the print statements.
Am I missing something obvious here?
Code:
#!/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use strict;
use LWP::Simple;
print "Content-type: text/html\n\n"; # prepare for HTML output
my $content = get("[URL unfurl="true"]http://www.mydomain.co.uk/dir/file.ext");[/URL]
die "Couldn't get it!" unless defined $content;
print "$content";
Keith