Skip Menu |

This queue is for tickets about the AI-Categorizer CPAN distribution.

Report information
The Basics
Id: 44206
Status: new
Priority: 0/
Queue: AI-Categorizer

Owner: Nobody in particular
Requestors: Steve.Cultrera [...]

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

Subject: Issue with AI::Categorizer::Storable
Date: Mon, 16 Mar 2009 13:03:02 -0400
To: <bug-AI-Categorizer [...]>
From: "Cultrera, Steve (Heritage Holdings, ACT)" <Steve.Cultrera [...]>
Download (untitled) / with headers
text/plain 1.3k
Hi, While not really a bug, the fact that save_state removes everything in the $path argument makes it a dangerous method. I thought save_state would just write some kind of file to $path, but it removes everything in $path and everything underneath it in the directory structure! Regardless, I appreciate the work that went into AI::Categorizer and into making it available. Still, there probably should at least be some mention of this behavior in the documentation. Code from sub save_state { my ($self, $path) = @_; if (-e $path) { File::Path::rmtree($path) or die "Couldn't overwrite $path: $!"; } mkdir($path, 0777) or die "Can't create $path: $!"; Storable::nstore($self, File::Spec->catfile($path, 'self')); } Steve Cultrera Sr. Business Information Consultant Heritage Holdings Actuarial 860.520.2764 ************************************************************ This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential and/or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. ************************************************************

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to