Web Hosting Talk







View Full Version : Trouble with Perl script.


slpc
08-22-2005, 03:08 AM
I must have path info wrong for an event specifc configuration file I use in a Perl script I'm migrating:

my $searchdatafilepath =
"http://IP-ADDRESS/res/sites/harry1/srchmenu_data/search_data";

When the script tries to open the $searcchdatafilepath, the open fails with a "no such file or directory".

srchmenu_data/search_data is definitely in "harry1". What do I have wrong about the path? CGI support was installed using the Plesk CP; is there something screwy with the way Plesk handles CGI/Perl? Why would I get a 'no such file or directory" on something this simple?

juniperavenue
08-22-2005, 04:46 AM
It sound to me like you are trying to acces the physical path through the URL. /res/sites/harry1 looks like the hosts physical path but the web root is probably harry1, making the correct URL "IP-ADDRESS/srchmenu_data/search_data".

fastduke
08-22-2005, 02:11 PM
If you are trying to access content on a server other than the local machine you might want to look into LWP::Simple

#!/usr/bin/perl
#
use strict;
use warnings;
use LWP::Simple;

my $content = get("http://IP-ADDRESS/res/sites/harry1/srchmenu_data/search_data");

print $content;