in reply to Format file2

Dear frd, Read the man page of Open command.

here I have posted the correct code. Check it.

use strict; use warnings; $a = "test", $b = "myfile"; open(IN, $a) || die "cannot open for reading, $! "; open(OUT,">$b") || die "cannot open for writing, $! "; + + while (<IN>) { print OUT "NO", "\n", " 'SOURCE' ", "SEC", "Q", "SEC ", "\n", "LON +G", "LAT", "DEPTH", "GAP" } close (IN); close (OUT);