Gossamer Forum
Home : Products : Gossamer Links : Discussions :

ConfigData.pm error when using nph-import.cgi

Quote Reply
ConfigData.pm error when using nph-import.cgi
Because of the HOOJness of the DMOPZ RDF, I transferred the GT app from its current home to a dev server where I could do the import. Now when I run nph-import.cgi I get an error message:
unable to load 'old/path/to/server/Links/ConfigData.pm ': No such file or directory. at Links.pm line 65.
and another one that si almost exactly the same.

Of course I edited ConfigData.pm ... same error message. Line 65 does not say that anymore.
Is there some issue with (I assume) compiled modules that precludes me being able to edit them with a text editor? or is there just some simple solution that has eluded my efforts and my search for similar more successful efforts?
Please advise.
Thanks-
grant stevens
L-EET Web Services
http;//l-eet.com
Quote Reply
Re: [grantstevens] ConfigData.pm error when using nph-import.cgi In reply to
The main .cgi scripts, and a lot of the .pm files contain the variable to this at the top of the script. The way to get around it is to manually go through each of the files, and manually change it (or use my script to do it for you Tongue).

Code:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use strict;

print "Content-type: text/html \n\n";

my $path = "/path/to/folder/you/have/lsql/in";
my $original = "/path/to/old/folder";
my $new = "/new/path/to/folder";

opendir (DIR, "$path");
my @files = readdir(DIR);
closedir(DIR);

undef($/);
for my $file (@files) {
if ($file =~ /(html|pm|cgi)$/) {
open(R, "$path/$file") || die "cant open file [$file] : $!";
my $data = (<R>);
close (R);
$data =~ s/$original/$new/ig;
open (W, ">$path/$file") || die "Error writing to file [$file]: $!";
print W "$data";
close (W);
}
}

print "done";

This script will go through the entire directory, and each file, and replace occurences of the old path, with the new one Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Nov 25, 2002, 9:28 AM
Quote Reply
Re: [Andy] ConfigData.pm error when using nph-import.cgi In reply to
Sorry but I wouldn't use that script, there are quite a few problems with it that could result in data loss.
Quote Reply
Re: [Paul] ConfigData.pm error when using nph-import.cgi In reply to
At least some of us are trying to help Paul! I used this script fine on several copies....simply make sure you have a second backup of the files, in the case of a problem. Its not hard to do! Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ConfigData.pm error when using nph-import.cgi In reply to
Quote:
some of us are trying to help Paul

I would class trying to stop someone from losing data as being helpful :)
Quote Reply
ConfigData.pm SOLVED In reply to
This problem was SOLVED by changing the path at the top of nph-import.cgi