blib/lib/Finance/FIX.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 21 / 21 CC 2 SCAR 3.4
CC
2
Cov
100%
parse
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
↑ Summary
1 package Finance::FIX;
2  
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 3 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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
40 1 my $class = shift;
41 1 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 1 ▶sub parse {
Subroutine parse: called CC=2 SCAR=6.9
Pod documented
51 1 my ( $self, $message ) = @_;
52 1 my $nodes;
53 1 for my $node ( split /\x01/, $message ) { # Split on "SOH"
54 25 push @$nodes, [ split /=/, $node, 2 ]; # Split tag and value on "="
55 }
56 1 return $nodes;
57 }
58  
59 =head1 AUTHOR
60  
61 Blair Christensen, C<< <blair.christensen at gmail.com> >>
62  
63 =head1 BUGS
64  
65 Please report any bugs or feature requests to C<bug-finance-fix at rt.cpan.org>, or through
66 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Finance-FIX>. 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<https://github.com/blairc/finance-fix.perl>
82  
83 =item * RT: CPAN's request tracker
84  
85 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Finance-FIX>
86  
87 =item * AnnoCPAN: Annotated CPAN documentation
88  
89 L<http://annocpan.org/dist/Finance-FIX>
90  
91 =item * CPAN Ratings
92  
93 L<http://cpanratings.perl.org/d/Finance-FIX>
94  
95 =item * Search CPAN
96  
97 L<http://search.cpan.org/dist/Finance-FIX/>
98  
99 =back
100  
101 =head1 ACKNOWLEDGEMENTS
102  
103 =head1 SEE ALSO
104  
105 L<http://en.wikipedia.org/wiki/Financial_Information_eXchange>, L<http://www.fixprotocol.org/>
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 3 1; # End of Finance::FIX
↑ Summary