http://qs321.pair.com?node_id=1212377


in reply to Re: Splitting a large file into smaller files according to indexes
in thread Splitting a large file into smaller files according to indexes

Works like a charm, thank you. How do I upvote this answer, sorry I am a newbie to perlmonks :)
Also, why do we initialize, $current_index as -1?