in reply to Suggestion on a Program

You don't need to open several files at the same time. Just open a new file only when you need to.
#!/usr/bin/perl use warnings; use strict; my @values = 1 .. 70; my @boundaries = (1, 10, 20, 40, 60); my $OUT; my $index = 0; for my $value (@values) { if ($index <= $#boundaries && $value == $boundaries[$index]) { $index++; open $OUT, '>', "output.$index" or die $!; print {$OUT} "HEADER\n"; } print {$OUT} $value, "\n"; }
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Suggestion on a Program
by ojagan (Novice) on Dec 02, 2015 at 19:06 UTC
    Thanks for the reply. I figured that and in my code that I already pasted I have opened files one at a time and closed it when done.