P
Paul Burton
I'm using the "do" function to read in a system configuration file
(which is just another perl script). "do" will search for the file using
the @INC path list.
The name of the file which is read is supplied by the user, so there is
the potential that the specified file doesn't exist.
Although I can put a check around the "do" statement to generate an
error and crash out, I'd really like to do this check at the top of the
program, where I'm checking all the user inputs are correct.
However, at this point I don't want to execute the "do". What I want is
a function which will search through the @INC directories and return an
error if the specified file is not found there, or the name of the first
directory matched otherwise.
Of course I could write my own to do this. But, I figure that all the
functions which use @INC (do, use, require etc.) must have to do
something like this already, so I thought there would be something
available to me to let me do this.
But, I can't find this. Can someone point me to something suitable, or
will I have to write my own?
TIA
Paul.
(which is just another perl script). "do" will search for the file using
the @INC path list.
The name of the file which is read is supplied by the user, so there is
the potential that the specified file doesn't exist.
Although I can put a check around the "do" statement to generate an
error and crash out, I'd really like to do this check at the top of the
program, where I'm checking all the user inputs are correct.
However, at this point I don't want to execute the "do". What I want is
a function which will search through the @INC directories and return an
error if the specified file is not found there, or the name of the first
directory matched otherwise.
Of course I could write my own to do this. But, I figure that all the
functions which use @INC (do, use, require etc.) must have to do
something like this already, so I thought there would be something
available to me to let me do this.
But, I can't find this. Can someone point me to something suitable, or
will I have to write my own?
TIA
Paul.