12345678910111213141516171819202122232425262728293031323334353637383940 |
- package SugarTrail::STM;
- # STM holder
- # new()
- # parse_headers()
-
-
-
- use strict;
- use warnings;
- use Carp;
-
- sub new {
- my $class = shift;
- my $args = { @_ };
- my $self = {};
- $self->{args} = $args;
- return bless $self, $class;
- }
-
- sub parse_headers {
- my $self = shift;
-
- my ($head, $body) = split "\n\n", $self->{text}, 2;
-
- my @lines = split "\n", $head;
-
- $self->{head} = $head;
- $self->{body} = $body;
-
- foreach (@lines) {
- my ($n, $v) = split ": ", $_, 2;
- $self->{meta}->{$n} = $v;
- }
-
- return 1;
-
- }
-
-
- 1;
|