Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: readline() on close filehandle $handle
by Corion (Patriarch) on Jun 05, 2008 at 10:06 UTC | |
|
Re: readline() on close filehandle $handle
by moritz (Cardinal) on Jun 05, 2008 at 10:10 UTC | |
|
Re: readline() on close filehandle $handle
by andreas1234567 (Vicar) on Jun 05, 2008 at 10:55 UTC |