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.
$abc{z}, in which case it's Perl code. Make sure the file ends with\%abc, and you can use friedo's code.