I am seeing this strange problem reading a file from an
user defined perl library module -- my.pm. Atleast the
problem is quite strange to me.
The footer information of a generated output text file
is getting cutoff while trying to read from this my.pm
But while I read the file from another script it prints
out fine. Some of the statements from script that
generates the output file - doReport.pl, the last few
lines from the output file - output.txt, and the my.pm
doReport.pl:
use my.pm;
...
format FOOTER =
@||||||||||||||||||||||||||||||||||
S = Scheduled R = Requested ...
"MyCompany Information Systems"
.
my.pm :
package my;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(print_report);
sub print_report
{
$file = "output.txt";
open (FILE,"$file") || die "Can't open $file for reading:
$!\n";
while ( defined($_ = <FILE>) ) {
print $_;
}
}
output.txt:
The last line from the file before the footer note -
WRITTEN-OFF EVENTS 20030614 Daily EN_US`AWS`20030613`20030613`
+YES
prints with out the footer notes!
Any idea why this is happening?
20030614 Edit by Corion: Added formatting and CODE tags
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.