http://www.perlmonks.org?node_id=1078889


in reply to search date occurance from csv column

It's not clear what you want to get as a result from your script. When you say:

… i need to use the current date search each column to get the number of occurrence from each columns

I'm afraid that doesn't make any sense in English. Perhaps you can give an example of data that should produce a particular output, and tell us what that particular output should be.

I notice that sample data you gave uses semi-colons between the fields (;), but you are using a comma in your split call (,), so @fields would always have a single element containing the whole line (because there are no commas), and $fields[2] will always be undef.

Anyway, assuming that you do the split the right way, what do you really want to do with the second date string of each line?