On Wed, 8 Sep 2004, Geetha B wrote:

But I want to write this as a package/interface file .
Please could you guide/direct me to writing a simple/sample perl package (sample.pm) & then testing it.

Sorry, I'm afraid I can't do that.

This list exists to help people get past the obstacles of learning Perl, but the learners have to put in an effort to read the documentation and start writing their own code before they can expect to get help.

If you're trying to get started, there are some good books on the topic:

 * _Object Oriented Perl_
   by Damian Conway; Manning, (c) 1999
   <http://www.manning.com/conway>
   <http://www.amazon.com/exec/obidos/tg/detail/-/1884777791>

 * _Learning Perl Objects, References & Modules_
   by Randal L. Schwartz with Tom Phoenix; O'Reilly, (c) 2003
   <http://www.oreilly.com/catalog/lrnperlorm/>
   <http://www.amazon.com/exec/obidos/tg/detail/-/0596004788>

Also, the relevant sections of _Programming Perl_, _Perl Cookbook_, etc.

Also see the relevant perldoc documentation:

 <http://www.perldoc.com/perl5.8.4/pod/perlboot.html>
 <http://www.perldoc.com/perl5.8.4/pod/perltoot.html>
 <http://www.perldoc.com/perl5.8.4/pod/perlobj.html>

Read some of this stuff over, try things out, then write back to the list when you get a chance to experiment and start hitting barriers.

If in a package file SNMP.pm, I need to define functions like
snmpcreatesession,
snmpget,
snmpgetnext .....
Can I write a perl package file following to OOP concepts ,i.e create an
instance of the SNMP
$snmpInstance = new SNMP(arguments)
SNMPgetResult = $snmpInstance->snmpget(arguments)

Yes, this can be done.

See above for guides as to how to do this.


-- Chris Devers

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to