in reply to Re^2: flushing the data from array
in thread flushing the data from array
No, I don't think I get your point. You're doing a lot of looping and returning an array that you create in the loop. You can't return the array during the loop because it's not actually finished yet.
Your original post mentions $|=1 (aka $OUTPUT_AUTOFLUSH if you use English). This is for sending output (as with print) without buffering (see perlvar). If your loop looks like this:
$| = 1; # output autoflush for ( 1 .. $x ) { push @array, $_; print "I did '$x'! Yay!\n"; }
...then in that case, $| makes a difference. If you're not actually generating any output during the loop, it won't matter. The $| setting is only for output.
If you leave $| to the default value (buffering), you'll get groups of lines at a time instead of each individually. Again, none of this has anything to do with looping or returning data.
|
|---|