Well, the warning says there is an uninitialized value in a pattern match, so clearly that means that $energy_consumption is undefined when you get there. That value is assigned in your split, so therefore the split isn't outputting at least 8 values. I suspect that your input file is not formatted as your expect. A quick way to find the offending lines would be to add the block
if (not defined $energy_consumption) { warn "Split missed, $file: $_"; next; }
after the split, and see what comes out. My guess is that you are working with tab-delimited files, and there are some empty values.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re^2: read the whole folder files
by kennethk
in thread read the whole folder files
by perllearner007
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |