go ahead... be a heretic | |
PerlMonks |
Re: Combining Files using Hashby dasgar (Priest) |
on Sep 05, 2017 at 05:47 UTC ( [id://1198677]=note: print w/replies, xml ) | Need Help?? |
I haven't tested your code or looked closely at your regexes. But here are a few thoughts. I believe that the two lines where you are trying to parse a line from a file need to have the regex within parentheses. In other words, change these original lines:
to make them look like the following:
An easy debugging step is to print out the variables to verify that they are indeed holding what you think they are. Based on your description of the error message, it sounds like one of your regex lines isn't matching for all lines of the file (such as the header line or blank lines). In looking at your data, it looks like the files are in CSV format. Although it might be tempting to use split to parse those lines, I think it probably would be better to use something like Text::CSV to parse those files.
In Section
Seekers of Perl Wisdom
|
|