If I want to have the same variables declared at the beginning of many different PERL files, as below, is there a way to have them in just one file and "include" this file in all the necessary files? It would be much easier this way for me because that way when I want to change one or both of their values, I only have to do it in one place as opposed to each file.
If the solutions is with a require, as in :
could you give a working example. I have seen examples where the includefile.pl contains functions, but not just variables, and when I tried to copy the examples, it didn't work.
ie includefile.pl is as follows:
but when I include this file with a require in another file, it says $variable1 and $variable2 are not defined (I am using strict).
Any suggestions as to what I can try to get this working?