Da_Lu has asked for the wisdom of the Perl Monks concerning the following question:
I'm developing a house-keeping program much like logrotate, but with some extension specifically modeled to our company. Since I want this thing to have as-readable-as-possible code I'm trying to go OOP all the way. And the proper way to do errors in OOP are exceptions (for all I know). Now, I know about Error, Exception::Class, and why $@ is unreliable.
But here's the crux of the thing: none of the servers really has any modules besides the core of 5.8.8, as packaged by ActiveState; none of the servers is allowed access to the Internet at all, so there's no CPAN; and finally, all third party software installs have to be approved and packaged for all possible systems.
So my question is: is there any other way for an half-way decent exception handling besides the fugly eval { ... }; if ( $@ ) { ... } or importing Error via the "smuggling bay" by making it part of my package?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Objects and Exceptions sans CPAN
by marto (Cardinal) on Jan 13, 2010 at 10:15 UTC | |
by Da_Lu (Acolyte) on Jan 13, 2010 at 10:39 UTC | |
by BrowserUk (Patriarch) on Jan 13, 2010 at 10:49 UTC | |
by Da_Lu (Acolyte) on Jan 13, 2010 at 11:45 UTC | |
by marto (Cardinal) on Jan 13, 2010 at 10:48 UTC | |
by Da_Lu (Acolyte) on Jan 13, 2010 at 11:45 UTC | |
|
Re: Objects and Exceptions sans CPAN
by almut (Canon) on Jan 13, 2010 at 10:22 UTC | |
|
Re: Objects and Exceptions sans CPAN
by JavaFan (Canon) on Jan 13, 2010 at 10:53 UTC | |
by Da_Lu (Acolyte) on Jan 13, 2010 at 11:49 UTC | |
|
Re: Objects and Exceptions sans CPAN
by ikegami (Patriarch) on Jan 13, 2010 at 16:29 UTC |