Subject: | Chemistry::File writing: append & no close options |
I had a (well, two :) -- but related) suggestion for
Chemistry::File->write() ....
In v0.36 the write() method has a "$self->close;" line -- it would be a
nice-to-have if it was:
$self->close unless $self->{opts}->{no_close};
so that something like this would work:
$mol->write(\*STDOUT, format => 'xyz', no_close=>1);
$mol->write(\*STDOUT, format => 'foo', no_close=>1);
Right now that would yield a "print() on closed filehandle STDOUT" error
on line 450.
Along similar lines, having $self->open('>'); be:
$self->open( $self->{opts}->{append} ? '>>' : '>' );
provides additional flexibility in case it's needed...
$mol->write("foo.out", format => 'xyz', no_close=>1, append=>1);
$mol->write("foo.out", format => 'foo', no_close=>1, append=>1);
This is probably only useful w/a filename (as opposed to handle) ..
wasn't sure at a glance if anything in ->open() would need modifying..
thanks!