my $variable = localtime; my $words = "This is the time : $localtime"; open (FH">>input.txt") or die "$!\n"; while () { print FH $words; }