Hello monks,

I am confronted with an error here I am not understanding for I have done this many time and this time it does not seem to work.
I looked at earlier code I made in Perl and it is pretty much done in a similar manner.
Any clues on why I have this error: readline() on close filehandle $handle?

Thanks

sub changeData{ my ($self) = @_; `$toolPath/an2k2txt ./Templates/DFP.nst ./tmp/Data2`; open my $handle, "<", "./Data2"; my $file = new IO::File("./$self->{_nistName}.tmp","w"); my $data; while(<$handle>){ if ($_ =~ m/$self->{_field}/i){ chomp($_); $_ =~ s/=.*//; #Seems that \x1F\x0A is the delimiter at the e +nd of the lines $data = $_."=".$self->{_newValue}."\x1F\x0A"; print $file $data; } else{ print $file $_; } print "$_\n"; } close $handle; `$toolPath/txt2an2k ./$self->{_nistName}.tmp ./Nist/$self->{_n +istName}.bad`; system("rm -f ./*.tmp"); }

In reply to readline() on close filehandle $handle by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.