line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::FIX; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
95661
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
82
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
5444
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Finance::FIX - Parse FIX protocol messages. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.01 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Finance::FIX; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Instantiate. |
23
|
|
|
|
|
|
|
my $fix = Finance::FIX->new; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Parse string containing a FIX message. |
26
|
|
|
|
|
|
|
# Returns an array of FIX nodes, broken down into array refs of tags and values. |
27
|
|
|
|
|
|
|
my $message = $fix->parse($message); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
require Data::Dumper; |
30
|
|
|
|
|
|
|
print Data::Dumper::Dumper( $message ), "\n"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 METHODS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 new |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Instantiate new Finance::FIX object. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
sub new { |
40
|
1
|
|
|
1
|
1
|
13
|
my $class = shift; |
41
|
1
|
|
|
|
|
6
|
return bless { @_ }, $class; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 parse($message) |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Parse B<$message>, returning array ref of FIX message nodes, broken down into array refs of tags |
47
|
|
|
|
|
|
|
and values. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
sub parse { |
51
|
1
|
|
|
1
|
1
|
7
|
my ( $self, $message ) = @_; |
52
|
1
|
|
|
|
|
2
|
my $nodes; |
53
|
1
|
|
|
|
|
14
|
for my $node ( split /\x01/, $message ) { # Split on "SOH" |
54
|
25
|
|
|
|
|
98
|
push @$nodes, [ split /=/, $node, 2 ]; # Split tag and value on "=" |
55
|
|
|
|
|
|
|
} |
56
|
1
|
|
|
|
|
8
|
return $nodes; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Blair Christensen, C<< >> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 BUGS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
66
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
67
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 SUPPORT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
perldoc Finance::FIX |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
You can also look for information at: |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=over 4 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * Source Repository |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item * CPAN Ratings |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
L |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * Search CPAN |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SEE ALSO |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L, L |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Copyright 2010 Blair Christensen. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
112
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
113
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
1; # End of Finance::FIX |