CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Question on OOPS Programming

 



cbz47perl
New User

Jun 18, 2009, 10:03 AM

Post #1 of 2 (1195 views)
Question on OOPS Programming Can't Post

Perl Module 1: I have Data Holder Object "XmlConfigObject.pm"

Code
package xmlIngestPackage::XmlConfigObject; 
sub new {
my $class = shift;
my $self = {
_id => shift,
_blogId => shift,
_xmlUrl => shift,
_xmlType => shift,
_xmlFrequency => shift,
};
bless $self, $class;
return $self;
}


Perl Module 2: I have a Controller "XmlIngestController.pm" with a subroutine "sub runXmlConfig". In this subroutine I have created and populated an array of XmlConfigObject(s)

Code
package xmlIngestPackage::XmlIngestController; 
sub runXmlConfig {

## THIS IS WORKING !
my @xmlConfigObjectArray = xmlIngestPackage::XmlIngestPlugin->getXmlConfigFromDatabase();

## HOW TO PASS MY CUSTOM OBJECT HERE and GET BACK ANOTHER CUSTOM OBJECT IN RETURN (is below statement correct)?
my $anotherCustomObjectArray = xmlIngestPackage::RSSParser->processXml(@xmlConfigObject[0]);

...
}

Perl Module 3: I have a Helper Class "RSSParser.pm" with a subroutine "sub processXml". In this subroutine I want to get an array of XmlConfigObject(s) as an argument, process it, create another array of objects "AnotherCustomObject(s)" and return it ????


Code
package xmlIngestPackage::RSSParser; 

sub processXml (xmlIngestPackage::XmlConfigObject $xmlConfigObject) {


# HOW DO I RECIEVE $xmlConfigObject Object in this sub routine ???
my @anotherCustomObjectArray;

...

return @anotherCustomObjectArray;

}



1arryb
User

Jun 19, 2009, 8:32 AM

Post #2 of 2 (1189 views)
Re: [cbz47perl] Question on OOPS Programming [In reply to] Can't Post

Hi cbz,

Please delete this duplicate post.

Larry

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives