Skip Menu |

This queue is for tickets about the Chemistry-Mol CPAN distribution.

Report information
The Basics
Id: 20069
Status: new
Priority: 0/
Queue: Chemistry-Mol

People
Owner: Nobody in particular
Requestors: davidrw [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.36
Fixed in: (no value)



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!