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


Manual Reference Pages  -  CHEMISTRY::PATTERN::ATOM (3)

.ds Aq ’

NAME

Chemistry::Pattern::Atom - An atom that knows how to match

CONTENTS

SYNOPSIS



    my $patt_atom = Chemistry::Pattern::Atom->new(symbol => C);
    $patt_atom->test_sub( sub {
        my ($what, $where) = @_;
        $where->bonds == 3 ? 1 : 0; # only match atoms with three bonds
    });



DESCRIPTION

Objects of this class represent atoms in a pattern. This is a subclass of Chemistry::Atom. In addition to the properties of regular atoms, pattern atoms have a method for testing if they match an atom in a molecule. By default, a pattern atom matches an atom if they have the same symbol. It is possible to substitute this by an arbitrary criterion by providing a custom test subroutine.

METHODS

$patt_atom->test($atom) Tests if the pattern atom matches the atom given by $atom. Returns true or false.
$patt_atom->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 atom and the second is the atom to match. It must return true if there is a match.
$patt_atom->map_to([$atom]) Returns or sets the atom that is considered to be matched by $patt_atom.

VERSION

0.27

SEE ALSO

Chemistry::Pattern

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

AUTHOR

Ivan Tubert-Brohman <itub@cpan.org>

COPYRIGHT

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PATTERN::ATOM (3) 2009-05-10

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