http://qs321.pair.com?node_id=1020610

punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:

Morphological Monks,

This is going to turn out to be something maddeningly simple...

I migrated a script from one host to another. Works fine on the old. But on the new I get an error:

Bad name after main' at ../config.pl line 18.
That line of code is a require:
require "../config.pl";
to load up some configuration variables. The file is located up one directory from the script and is chmoded 755.

If I change the relative path to anything else - like ../../ or ./ or just the filename, then I get

Can't locate ../../config.pl in @INC (@INC contains: .....
and a list of the directories in @INC.

Why the one error when the path is ../ and the other for any other path? Do I need to add something to @INC to include the current directory of the script that's running?

Thanks.

*****UPDATE*****

Solved - please see my last post below.




Time flies like an arrow. Fruit flies like a banana.