perl_seeker has asked for the wisdom of the Perl Monks concerning the following question:
When writing these values and other computed values to a report file(.doc) using the code below:open PL, 'pvclength.txt' or die "Cant open file"; pvc_l=<PL>; open GIL, 'gilength.txt'or die "Cant open file"; $gipipe_l=<GIL>; open QGBS, 'qgibendsocket.txt' or die "Cant open file"; $gibend_sck_q=<QGBS>;
The expected output is:printf EH "\n Item"; printf EH "\n No Descr. Qty Unit Rate Comp. + Party"; printf EH "\n 70 Pvc 4sqmm $pvc_l MTR 35.14 0.00 + $pvc_a"; printf EH "\n 71 Gi Pipe 25mm $gipipe_l MTR 94.93 0.00 + $gipipe_a\n"; printf EH "\n 73 Gi Bend $gibend_sck_q NO 50.00 0.00 + $gibend_sck_a\n"; printf EH "\n &Socket25mm\n";
But the output I get is this i.e. everything after the Qty figure appearing on the second lineItem No Descr. Qty Unit Rate Comp. Party 70 Pvc 4sqmm 2 MTR 35.14 0.00 70.28 71 Gi Pipe 25mm 3 MTR 94.93 0.00 284.79 73 Gi Bend 4 NO 50.00 0.00 200 &Socket25mm
How to get around this problem? I tried removing whitespace from the Qty variables for example $pvc_l but that did not work. Any advice would be appreciated. Thanks.Item No Descr. Qty Unit Rate Comp. Party 70 Pvc 4sqmm 2 MTR 35.14 0.00 70.28 71 Gi Pipe 25mm 3 MTR 94.93 0.00 284.79 73 Gi Bend 4 NO 50.00 0.00 200 &Socket25mm
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File write problem
by dHarry (Abbot) on Jul 08, 2010 at 13:29 UTC | |
by toolic (Bishop) on Jul 08, 2010 at 13:37 UTC | |
|
Re: File write problem
by kennethk (Abbot) on Jul 08, 2010 at 14:13 UTC | |
|
Re: File write problem
by roboticus (Chancellor) on Jul 08, 2010 at 17:08 UTC | |
by perl_seeker (Scribe) on Aug 03, 2010 at 12:05 UTC |