beginning of redesign
[p5sagit/Email-Archive.git] / test_run
CommitLineData
8581da38 1#!/usr/bin/perl
2use strict;
3use warnings;
4use Email::Simple;
5use Email::Simple::Creator;
6
8581da38 7use Email::Archive;
8
9my $email = Email::Simple->create(
10 header => [
c5f5125c 11 From => 'foo@example.com',
8581da38 12 To => 'drain@example.com',
13 Subject => 'Message in a bottle',
14 'Message-ID' => 'helloworld',
15 ],
16 body => 'hello there!'
17);
18
c5f5125c 19my $e = Email::Archive->new();
20$e->storage->db_connect('dbi:SQLite:dbname=test.db');
8581da38 21print "sending @{[$email->as_string]}\n";
22$e->store($email);
23
24my $found = $e->retrieve('helloworld');
25print $found->as_string;