use Math::Trig; #USE THIS MODULE # # Method to run FORTRAN script. # Code by - Shourjya Sanyal. Nov 2012. Dublin Ireland. print "***************************** \n"; print "PLOT DATA TO XMGRACE \n"; print "***************************** \n"; $const = 0.5; for ($count = 1; $count < 2; $count = $count+1) { $inputfile = 'data.out'; print "$inputfile\n"; $outputfile = 'output.dat'; open (FHT, ">$outputfile"); print FHT "#File was created by Programme \n"; print FHT "#By AUTHOR NAME - DATA\n"; print FHT "#\n"; print FHT "@ title \"Intensity Vs Length\"\n"; print FHT "@ xaxis label \"Length\"\n"; print FHT "@ yaxis label \"(Intensity)\"\n"; print FHTs "\@TYPE xy\n"; open (FH,$inputfile) || die("Could not open file!"); # load the file into an array chomp(@data = ); close(FH); for ($line = 0; $line < scalar @data; $line++) { $mydata = @data[$line]; @aa= split(' ',$mydata); @store = @aa[1]; @store1 = sprintf("%.15f", @store); $capr = ($line+4)*$const; $caprr = sprintf("%.14f", $capr); print FHT " $caprr @store1\n"; } close FHT; }