my (@thetas, @press); my ($i); use strict; use warnings; my $outfilename = "pot_temp.txt";# define an output filename open(TFILE,">$outfilename"); print "What is the temperature (K)? \n"; my $T = ; chomp ($T); for ($i=500, $i=900 , $i += 100) { my $theta = $T*((1013/$i)**(287/1004)); push (@press, $i); push (@thetas,$theta); } print TFILE "A T of $T results in thetas of @thetas at the pressure levels @press \n";