Hello
I am working in tooling project. And are using perl for code (C-Code) generation. My part in this is a bit different i use perl for generating a test-configuration. At this moment i want to read-in a config file to analyze it line by line. (Yes, i am using strict, warnings and diagnositcs!)
Just like this:
open( my $FILE, "< $TestBench_File" )|| die "Error[...]";
my @content = <$FILE>;
I expect that
@content is an array with an item per line in the file. This works often. But every now and then
@content has only one Element and the element is the complete content of the file (with all linebreaks and stuff). My wild guess: somewhere in the code-gen part the io is set to something special. But i have no idear where and how.. I asked my colleagues but none of them are aware of this.
Does anyone know how to solve this? Yes, i could do a
split on the one array-elemet.. but do not feel that this is a good approach.. only a fallback solution...
Help is highly welcome!!
Best regards Tobias