Exceptions used by ropkg packages
RoPkg::Exceptions is a collection of predefined exceptions used by all modules from RoPkg namespace.
#!/usr/bin/perl
use strict; use warnings;
use RoPkg::Exceptions;
sub main { eval { if ( $#ARGV == -1 ) { Param::Missing->throw('No parameter found'); } };
if ( my $e = Exception::Class->caught('Param::Missing') ) { print STDERR $e->message,$/,$e->trace,$/; } }
main();
It is very possible that you don't find a good reason for using exceptions from this example. And you are right. This example is kind of silly. But, try to use exceptions in a real project. Then, you will apreciate their real value.
RoPkg::Exceptions require perl 5.008 or later and the Exception::Class module.
The following exceptions are defined in this class:
RoPkg::Utils
Subredu Manuel <[email protected]>
The current version is 0.2.1
The tests for this module are located in t directory. To run those tests, use the following command: make test
This module does not have any public methods.
None known to me
This module is perl critic level 1 compliant with 1 exception.
No known bugs. If you find one (or many) please send me a detailed report.
No configuration file or environment variables are used by this module.
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The \s-1LICENSE\s0 file contains the full text of the license.