use strict; open(DAT, "export.dat")||die "Cannot open export.dat for read:$!\n"; my @temp_lines; push @temp_lines, scalar ; my $closed = 1; while($temp_lines[0] !~ /^$/){ open(TEMP, ">temp.dat") if $closed; $closed = 0; push @temp_lines, (eof DAT) ? '' : (scalar ) ; print TEMP shift @temp_lines; if($temp_lines[0] =~ /^(1|)/){ close TEMP; &output_data(); $closed = 1; } } close DAT; sub output_data{ print "in output_data\n"; open(TEST, 'temp.dat')||die "cannot open temp in sub:$!\n"; while(){ chomp; print "$_\n" if $_ =~ /\S/; } print "end of output_data\n"; } #### map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20