Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Path-Class CPAN distribution.

Maintainer(s)' notes

I prefer that bugs & patches are filed on GitHub rather than on RT: https://github.com/kenahoo/Path-Class/issues. Thanks.

Report information
The Basics
Id: 55269
Status: open
Priority: 0/
Queue: Path-Class

People
Owner: Nobody in particular
Requestors: nickolay8 [...] gmail.com
Cc:
AdminCc:

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



Subject: [Feature request] anti-slurp - write string to file with single method call
Hello, First of all, thanks for this great module! Save me a lot of time and printed lines ) Would like to propose to implement the "anti-slurp" method: I found myself repeating this code in my simple build scripts: my $fh = $blib_dir->file("somefile.txt")->openw; print $fh $embedder->mhtml_as_string; $fh->close; think would be very convenient to just write: my $fh = $blib_dir->file("somefile.txt")->save($embedder->mhtml_as_string) Thanks again, Nickolay
Sounds like a good idea. I'm not crazy about "save" as a method name, it implies something that maintains in-memory state then writes that state to disk. If we want the new method to just accept a string, we could call it spew(). If we want it to be able to take input from an array, or a filehandle object, or whatever, and just DTRT, perhaps it should be called write() or something. -Ken
From: nickolay8 [...] gmail.com
I'm for "spew" (as its very anti-slurp-ishly :), and also for DTRT in provided parameters. Nickolay On Fri Mar 05 17:17:20 2010, KWILLIAMS wrote: Show quoted text
> Sounds like a good idea. I'm not crazy about "save" as a method name, > it implies something that maintains in-memory state then writes that > state to disk. > > If we want the new method to just accept a string, we could call it
spew(). Show quoted text
> > If we want it to be able to take input from an array, or a filehandle > object, or whatever, and just DTRT, perhaps it should be called write() > or something. > > -Ken