Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Real world examples

Reply
Thread Tools

Real world examples

 
 
rc
Guest
Posts: n/a
 
      11-21-2004
Hi, I would like some help in finding some "real world" Perl
application examples. Everything I'm finding are short programs
without proper logging and error handling and only accomplish a simple
task.
Here's what I'm trying to accomplish for my first application:

1. Write a singleton class/module that will create/hold a file handle
to do logging (I found a singleton example in an old "ThePerlReview").
This way all the other modules I write can simply call methods this
object to do logging. -- Is this a good idea, how is it done in the
real world so all modules can write to the same log?

2. Write a class/module that will read a configuration file in a
generic way (so like the logging class, I can reuse it for other
projects). This way I can call get/set... methods, I've seen a great
generic example in "Object Oriented Perl" for the get/set part. -- I
want to do this instead of sourcing in a hash so it can check that
valid methods are being called.

3. Write a wrapper around Net::FTP that will catch exceptions and
retry login/put/get if time outs occur. This class will use the
logging singleton class to write to the same filehandle that the main
application and all other modules are witting too.

4. The actual application will use these modules and setup the logging
singleton.

Any help in pointing resources that do any of these specific things
and especially an "application" that does things similar to this would
be greatly appreciated.

Thanks

 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      11-22-2004
"rc" <(E-Mail Removed)> wrote in news:1101076183.352311.218570
@f14g2000cwb.googlegroups.com:

> 1. Write a singleton class/module that will create/hold a file handle
> to do logging (I found a singleton example in an old "ThePerlReview").
> This way all the other modules I write can simply call methods this
> object to do logging. -- Is this a good idea, how is it done in the
> real world so all modules can write to the same log?


http://search.cpan.org/~mschilli/Log...og/Log4perl.pm
among others

> 2. Write a class/module that will read a configuration file in a
> generic way (so like the logging class, I can reuse it for other
> projects). This way I can call get/set... methods, I've seen a great
> generic example in "Object Oriented Perl" for the get/set part. -- I
> want to do this instead of sourcing in a hash so it can check that
> valid methods are being called.


http://search.cpan.org/~kane/Config-...Config/Auto.pm among
others

> 3. Write a wrapper around Net::FTP that will catch exceptions and
> retry login/put/get if time outs occur. This class will use the
> logging singleton class to write to the same filehandle that the main
> application and all other modules are witting too.


If you so wish ...

> 4. The actual application will use these modules and setup the logging
> singleton.


OK.


--
A. Sinan Unur
http://www.velocityreviews.com/forums/(E-Mail Removed)d
(remove '.invalid' and reverse each component for email address)

 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      11-22-2004
rc wrote:

> projects). This way I can call get/set... methods, I've seen a great
> generic example in "Object Oriented Perl" for the get/set part. -- I
> want to do this instead of sourcing in a hash so it can check that
> valid methods are being called.


If you use the proxy method, you can set up a hash to verify if the method
is allowed, see perltoot, Autoloaded Data Methods for example.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

 
Reply With Quote
 
Alan Mead
Guest
Posts: n/a
 
      11-22-2004
On Sun, 21 Nov 2004 14:29:43 -0800, rc wrote:

> Hi, I would like some help in finding some "real world" Perl application
> examples. Everything I'm finding are short programs without proper
> logging and error handling and only accomplish a simple task.


I agree that there are a lot of short examples and not a lot of big
applications. One exception is that some modules on CPAN are pretty
comprehensive and pretty sizable.

There are examples of full-blown applications but one issue is that they
might have been written for a different version of Perl or they might just
not be written very well.

So, I suggest that you make your own application and post here with
specific questions as/if problems arise.

-Alan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed: Real-world examples for Python's Cooperative Multiple Inheritance Raymond Hettinger Python 31 05-19-2011 04:24 AM
Books and web resources with real-world Java examples philoscantos@yahoo.com Java 1 05-06-2008 05:17 AM
Real-world examples PontiMax ASP .Net 2 08-26-2003 09:13 AM



Advertisments