in reply to Range Operator Mysteries
$count is set to start at 1 to disreguard the first array element (assuming the first line of the file is a delimeter line). It's not the most memory efficient, but it seems to do the trick. -Moolocal $/; open(INPUT, shift) or die "Unable to open input file: $!\n"; $input = <INPUT>; close INPUT; @input = split /=+\n/, $input; foreach $count ( 1 .. $#input ) { open(OUT, ">$count.txt") or die "Unable to open output file: $!\n" +; print OUT $input[$count]; close OUT; }
|
|---|