You need to cast it to the specific subclass first. Try calling $newad = toSetData($ad) and then if ($newad && $newad->GetAlias() eq "Xx")
- Noel On 21 March 2011 15:06, Igor Filippov [Contr] <filipp...@mail.nih.gov> wrote: > Dear Colleagues, > > I need to implement in Perl a procedure which is C++ looks like the > following: > .... > AliasData *ad; > ad = (AliasData *) a->GetData(OBGenericDataType::SetData); > if (ad != NULL && ad->GetAlias() == "Xx") > .... > > This is what I have at the moment and it does not work unfortunately: > .... > $ad=$atom->GetData($Chemistry::OpenBabel::OBGenericDataType::SetData); > if ($ad && $ad->GetAlias() eq "Xx") > .... > > It doesn't seem to work even if I replace > $Chemistry::OpenBabel::OBGenericDataType::SetData > with it's numerical value - 23. > > Any recommendations will be most welcome! > Igor > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss