in reply to Splitting a Blocked file in Round Robin into smaller files

Im not quite sure what you are wanting to end up with but try this:
use strict; use warnings; my @array = qw( 1nkndnfd 2nsnskdnsdn 3ddjsjd 4fksjsdj 5kdsjdskjdskj 1ksdjdjsk hg 2dsjskj 3djkdjsljs 4fdkkjdskjsk 5sadjjdjdodjs 6sadjjdjdodjs ); foreach (@array) { my ( $num, $data ) = /(\d)(.*)/; next if ( !length $num || !length $data || $num !~ /[1-5]/ ); open my $file, '+>>', "round_robin_$num" . ".txt"; print $file "$num - $data\n"; }
EDIT: Just noticed other replies, looks this is NOT what he/she was after.

Replies are listed 'Best First'.
Re^2: Splitting a Blocked file in Round Robin into smaller files
by tradersjoe0 (Novice) on Dec 14, 2015 at 16:25 UTC

    Thank you so much for taking time to look into my question

      Hey no problem man, I do try to help when I can. I atleast give ideas if anything else haha :)