in reply to reading files in a directory with range operator.

This is your line 6:
2009-12-24_,5587
After your 1st split, $content[0] contains the string 2009-12-24_, as desired. Then you split that string on the underscore character. The resulting array, @datesplit, now has only one element. The problem arises because you expected that array to contain (at least) two elements in your next line:
$csvprint = "$datesplit[0],$datesplit[1],$content[1]\n";
If this line represents valid input data, then you must check how many elements are in your @datesplit array if you want to avoid this warning. Perhaps you want to do something like this:
if (@datesplit > 1) { $csvprint = "$datesplit[0],$datesplit[1],$content[1]\n"; } else { $csvprint = "$datesplit[0],$content[1]\n"; }