I have a perl file containing some hash references (abc.pl) and i want to open this file in another perl file, so that i can convert it to json using Json XS. When i try to open abc.pl, perl reads it as text and i am unable to convert it into json.
So, i just wanted to know the way to read abc.pl in another perl file so that the hash references are read properly and then can be converted to json.
Assuming you have a data file that looks something like this:
You can evaluate the structure using do function. For example,