terms5 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w my @times; my $timeDisplay; my $timeMinute = `date '+%M'`; my $timeHour = `date '+%H'`; $timeDisplay = join (":", "$timeHour", "$timeMinute"); open(IN1, '<', 'fileTimes'); #fills @times with data in fileTi +mes while(my $line = <IN1>) { chomp $line; unshift(@times, $line); } close(IN1); unshift(@times, $timeDisplay); #puts in new time to queue open(FILE, ">fileTimes"); foreach my $i (@times) { #prints back into fileTimes to upda +te print FILE "$i\n"; } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: joining two variables and printing them to a file?
by GrandFather (Saint) on Apr 25, 2006 at 05:55 UTC | |
by terms5 (Initiate) on Apr 25, 2006 at 06:33 UTC | |
|
Re: joining two variables and printing them to a file?
by Zaxo (Archbishop) on Apr 25, 2006 at 05:49 UTC |