librg-exception-perl-1.0.3000755150751150751 011777274667 15475 5ustar00lkajanlkajan000000000000librg-exception-perl-1.0.3/MANIFEST000444150751150751 14411777274667 16742 0ustar00lkajanlkajan000000000000Build.PL Changes lib/RG/Exception.pm MANIFEST This list of files MANIFEST.SKIP META.yml META.json librg-exception-perl-1.0.3/META.yml000444150751150751 134311777274667 17104 0ustar00lkajanlkajan000000000000--- abstract: 'This package provides the RG::Exception module used in certain scripts from the Rost Lab.' author: - 'Laszlo Kajan ' build_requires: {} configure_requires: Module::Build: 0.38 dynamic_config: 1 generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110440' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: librg-exception-perl provides: RG::Exception: file: lib/RG/Exception.pm version: 0 RG::Exception::NotImplemented: file: lib/RG/Exception.pm version: 0 RG::Exception::SyntaxError: file: lib/RG/Exception.pm version: 0 resources: license: http://dev.perl.org/licenses/ version: v1.0.3 librg-exception-perl-1.0.3/MANIFEST.SKIP000444150751150751 147011777274667 17532 0ustar00lkajanlkajan000000000000\bdebian/ #!start included /usr/share/perl/5.10/ExtUtils/MANIFEST.SKIP # Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b \B\.gitignore\b \b_darcs\b # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ # Avoid Devel::Cover files. \bcover_db\b #!end included /usr/share/perl/5.10/ExtUtils/MANIFEST.SKIP # Avoid Module::Build generated and utility files. \bBuild$ \bBuild.bat$ \b_build \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # Avoid archives of this distribution \blibrg-exception-perl-[\d\.\_]+ ^MYMETA\.yml$ ^MYMETA\.json$ librg-exception-perl-1.0.3/META.json000444150751150751 211611777274667 17253 0ustar00lkajanlkajan000000000000{ "abstract" : "This package provides the RG::Exception module used in certain scripts from the Rost Lab.", "author" : [ "Laszlo Kajan " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110440", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "librg-exception-perl", "prereqs" : { "configure" : { "requires" : { "Module::Build" : "0.38" } } }, "provides" : { "RG::Exception" : { "file" : "lib/RG/Exception.pm", "version" : 0 }, "RG::Exception::NotImplemented" : { "file" : "lib/RG/Exception.pm", "version" : 0 }, "RG::Exception::SyntaxError" : { "file" : "lib/RG/Exception.pm", "version" : 0 } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ] }, "version" : "v1.0.3" } librg-exception-perl-1.0.3/Changes000444150751150751 105311777274667 17124 0ustar00lkajanlkajan000000000000librg-exception-perl (1.0.3) unstable; urgency=low * Added Changes change log to package. * Corrected and added license (perl_5). -- Laszlo Kajan Wed, 11 Jul 2012 14:31:39 +0200 librg-exception-perl (1.0.2) unstable; urgency=low * Debianization moved out for packaging. -- Laszlo Kajan Tue, 03 Jul 2012 13:29:45 +0200 librg-exception-perl (1.0.1) unstable; urgency=low * New package for RG::Exception -- Laszlo Kajan Wed, 19 Oct 2011 16:13:12 +0200 # vim:textwidth=78: librg-exception-perl-1.0.3/Build.PL000444150751150751 70511777274667 17110 0ustar00lkajanlkajan000000000000use warnings; use strict; use Module::Build; Module::Build->new( module_name => 'RG::Exception', license => 'perl', configure_requires => { 'Module::Build' => 0.38 }, dist_name => 'librg-exception-perl', dist_version => '1.0.3', dist_author => [ 'Laszlo Kajan ' ], dist_abstract => 'This package provides the RG::Exception module used in certain scripts from the Rost Lab.' )->create_build_script; # vim:et:ts=2:ai: librg-exception-perl-1.0.3/lib000755150751150751 011777274667 16243 5ustar00lkajanlkajan000000000000librg-exception-perl-1.0.3/lib/RG000755150751150751 011777274667 16553 5ustar00lkajanlkajan000000000000librg-exception-perl-1.0.3/lib/RG/Exception.pm000444150751150751 537311777274667 21214 0ustar00lkajanlkajan000000000000package RG::Exception; ############################################################################## # # Copyright: 2008 László Kaján # # License: This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself, either Perl version 5.8.8 or, # at your option, any later version of Perl 5 you may have available. # ############################################################################## # RG exception base class # Typical use: # die RG::Exception->new( { msg => 'error message' } ); ############################################################################## use strict; use Carp; $Carp::CarpInternal{ 'RG::Exception' }++; sub new { my $this = shift; my $class = ref($this) || $this; my $self = {}; bless $self, $class; $self->_initialize( @_ ); return $self; } sub _initialize # protected method { my( $self, %__p ) = @_; # { msg => str } if( !$__p{msg} ) { $__p{msg} = ''; } # set properties while( my( $key, $val ) = each( %__p ) ) { $self->$key( $val ); } } # Overloaded string conversion operator. Returns "Uncaught exception 'REFERENCE':".msg(). Normally you would catch the exception and emit the message msg() of it. use overload '""' => sub{ return 'Uncaught exception \''.ref($_[0])."\':\n".$_[0]->msg_stack_backtrace(); }; sub msg # error message { if( @_ > 1 ) { $_[0]->msg_stack_backtrace( Carp::longmess( $_[1] ) ); return $_[0]->{_msg} = Carp::shortmess( $_[1] ); } else { return $_[0]->{_msg}; } } # Error message appended with the output of Carp::longmess(), a stack backtrace. See: L. sub msg_stack_backtrace # error message { return ( @_ > 1 ? $_[0]->{_msg_stack_backtrace} = $_[1] : $_[0]->{_msg_stack_backtrace} ); } package RG::Exception::NotImplemented; use strict; use Carp; $Carp::CarpInternal{ 'RG::Exception::NotImplemented' }++; use base qw( RG::Exception ); # inheritance ############################################################################## # Typical use: # die RG::Exception::NotImplemented->new(); ############################################################################## sub _initialize # protected method { my( $self ) = @_; $self->SUPER::_initialize( msg => 'not implemented' ); } package RG::Exception::SyntaxError; use strict; use Carp; $Carp::CarpInternal{ 'RG::Exception::SyntaxError' }++; use base qw( RG::Exception ); # inheritance ############################################################################## # Typical use: # die RG::Exception::Parser::SyntaxError->new( { msg => 'syntax error on line $lineno' } ); ############################################################################## 1; # vim:et:ts=2:ai: