A search for "localtime" gives you some info on the function :
$now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994"
I suspect you need to open the file for writing ?
open ( FILE, ">>input.txt" ) or die ( "input.txt: $!" );
So the main problem i see here is your string "This is the local time :" is not included any where in the code,
so how would it know to print "This is the time : $now_string" to the file?
Try this :
my $variable = localtime;
my $words = "This is the time : $localtime";
open (FH">>input.txt") or die "$!\n";
while (<FH>) {
print FH $words;
}
<font color="#0000ff"<Azatoth a.k.a Captain Whiplash
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?