GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Pattern::Bond(3) User Contributed Perl Documentation Pattern::Bond(3)

Chemistry::Pattern::Bond - A bond that knows how to match

    my $patt_bond = Chemistry::Pattern::Bond->new(order => 2);
    $patt_bond->test_sub( sub {
        my ($what, $where) = @_; 
        $where->type eq 'purple' ? 1 : 0; # only match purple bonds
    });

Objects of this class represent bonds in a pattern. This is a subclass of Chemistry::Bond. In addition to the properties of regular bonds, pattern bonds have a method for testing if they match an bond in a molecule. By default, a pattern bond matches an bond if they have the same bond order or both are aromatic. It is possible to substitute this by an arbitrary criterion by providing a custom test subroutine.

$patt_bond->test($bond)
Tests if the pattern bond matches the bond given by $bond. Returns true or false.
$patt_bond->test_sub(\&my_test_sub)
Specify an arbitrary test subroutine to be used instead of the default one. &my_test_sub must take two parameters; the first one is the pattern bond and the second is the bond to match. It must return true if there is a match.
$patt_bond->map_to([$bond])
Returns or sets the bond that is considered to be matched by $patt_bond.

0.27

Chemistry::Pattern

The PerlMol website <http://www.perlmol.org/>

Ivan Tubert-Brohman <itub@cpan.org>

Copyright (c) 2009 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2009-05-10 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.