in reply to Problem splitting Time::Local result
you want split(' ', $DatStr1), not split(/ /, $DatStr1) - the first form produces one field from the space in front of 11 or the 2 spaces in front of 9, but the second form creates an extra blank field from the 2 spaces infront of 9.
In your current code,
producesprint scalar(@text_dat1), " ", scalar(@text_dat2), "\n";
6 5
Changing the / / to ' ' makes the scalars equal and fixes your problem. 'perldoc -f split' covers this.
Also, your scalars of form @text_dat2[0] should be $text_dat2[0], as noted by diagnostics.
--Bob Niederman, http://bob-n.com
|
|---|