Fingo has asked for the wisdom of the Perl Monks concerning the following question:
This is a peice of some horrible code I wrote which I intend to fix (Im very much a newbie) WRITERT writes to a file called rt.log, what stumps me is that t does not write all of the feilds in the file. Can anybody tell me my mistake? thankssub rtdeposit { #Please see NOTE at the top of this file open(WRITERT, ">rt.log") || die "Cannot open rt.log"; print "\nStarting Month:"; chomp($smon = <STDIN>); print "\nStarting Day:"; chomp($sday = <STDIN>); print "\nStarting Year (4 digit):"; chomp($syear = <STDIN>); print "\nDuration in Days:"; chomp($dur = <STDIN>); print "\nAmount to Add:"; chomp($add = <STDIN>); print "\nDescription:"; chomp($desc = <STDIN>); $sdate = Date_to_Days($syear,$smon,$sday); print WRITERT "deposit\n$add\n$dur\n$desc\n$sdate"; reload(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Very weird
by Yohimbe (Pilgrim) on Feb 15, 2001 at 03:50 UTC | |
by Fingo (Monk) on Feb 15, 2001 at 03:54 UTC | |
|
(ichimunki) Flush your buffers when writing/reading files
by ichimunki (Priest) on Feb 15, 2001 at 03:28 UTC | |
by Fingo (Monk) on Feb 15, 2001 at 03:41 UTC | |
by ichimunki (Priest) on Feb 15, 2001 at 03:44 UTC | |
by Fingo (Monk) on Feb 15, 2001 at 03:57 UTC |