
App::Chart::Sympred -- symbol predicate objects

use App::Chart::Sympred;
my $sympred = App::Chart::Sympred::Suffix->new ('.AX');
$sympred->match('FOO.AX') # returns true

A App::Chart::Sympred object represents a predicate for use on stock and commodity symbols, ie. a test of whether a symbol has a certain suffix or similar.

Return true if $symbol is matched by the $sympred object.
Check that $obj is a App::Chart::Sympred object, throw an error if not.
Return a new App::Chart::Sympred object which matches only the given symbol exactly. Eg.
my $sympred = App::Chart::Sympred::Equal->new ('FOO.BAR')
Return a new App::Chart::Sympred object which matches the given symbol suffix. Eg.
my $sympred = App::Chart::Sympred::Suffix->new ('.FOO')
Return a new App::Chart::Sympred object which matches the given symbol prefix. Eg.
my $sympred = App::Chart::Sympred::Prefix->new ('^NZ')
Return a new App::Chart::Sympred object which matches the given regexp pattern. Eg.
my $sympred = App::Chart::Sympred::Regexp->new (qr/^\^BV|\.SA$/);
Return a new App::Chart::Sympred object which calls the given proc subroutine to test for a match. Eg.
sub my_fancy_test {
my ($symbol) = @_;
return (some zany test on $symbol);
}
my $sympred = App::Chart::Sympred::Proc->new (\&my_fancy_test);
Return a new App::Chart::Sympred object which is true if any of the given $pred predicates is true. Eg.
my $nz = App::Chart::Sympred::Suffix->new ('.NZ')
my $bc = App::Chart::Sympred::Suffix->new ('.BC')
my $sympred = App::Chart::Sympred::Any->new ($nz, $bc);
Add additional predicates to a App::Chart::Sympred::Any object.