Below code snippet when executed from within a perl script, gives only $datetime."12/31/9999,AUTO,.$datetime as ouput.
my $datetime=`date "+%D %r"`;
open(FIN,"<$file_in") or die $!."\n";
open(FOUT,">$file_out") or die $!."\n";
my @lines=<FIN>;
close(FIN);
foreach(@lines){
$msg=$_;
chomp($msg);
$msg=$msg.",".$datetime.",12/31/9999,AUTO,".$datetime;
print FOUT $msg."\n";
}
close(FOUT);
If i remove the chomp though, it gives me the line of <FIN>, followed by newline, followd by the appended items. Help please?
The file <FIN> was ftp'd in binary mode. Could this be an issue?