+sub delete_post {
+ my $postid=shift;
+ my $post = $mt->getPost($postid) or die "$!";
+ my $categories = $mt->getPostCategories($postid) or die "$!";
+ if(defined($opts{file})) {
+ if($opts{file} eq "-") {
+ print STDOUT $post->{description}, "\n";
+ } else {
+ open FH, ">".$opts{file} or die "$!";
+ print $opts{file}, "\n";
+ print FH $post->{description}, "\n";
+ close FH;
+ }
+ }
+ $mt->deletePost($postid,1);
+}
+