| 1 | 12 | ▶ | use 5.008001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 12 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 12 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | package Getopt::Lucid::Exception; | ||
| 5 | # ABSTRACT: Exception classes for Getopt::Lucid | ||
| 6 | |||
| 7 | 12 | our $VERSION = '1.09'; | |
| 8 | |||
| 9 | 12 | ▶ | use Exporter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 12 | our @ISA = qw/Exporter Exception::Class::Base/; | |
| 11 | 12 | our @EXPORT = qw( throw_spec throw_argv throw_usage); | |
| 12 | |||
| 13 | use Exception::Class 1.23 ( | ||
| 14 | 12 | "Getopt::Lucid::Exception" => { | |
| 15 | description => "Unidentified exception", | ||
| 16 | }, | ||
| 17 | |||
| 18 | "Getopt::Lucid::Exception::Spec" => { | ||
| 19 | description => "Invalid specification", | ||
| 20 | }, | ||
| 21 | |||
| 22 | "Getopt::Lucid::Exception::ARGV" => { | ||
| 23 | description => "Invalid argument on command line", | ||
| 24 | fields => ['usage'], | ||
| 25 | }, | ||
| 26 | |||
| 27 | "Getopt::Lucid::Exception::Usage" => { | ||
| 28 | description => "Invalid usage", | ||
| 29 | }, | ||
| 30 | |||
| 31 | 12 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | |||
| 33 | 12 | my %throwers = ( | |
| 34 | throw_spec => "Getopt::Lucid::Exception::Spec", | ||
| 35 | throw_argv => "Getopt::Lucid::Exception::ARGV", | ||
| 36 | throw_usage => "Getopt::Lucid::Exception::Usage", | ||
| 37 | ); | ||
| 38 | |||
| 39 | 12 | for my $t ( keys %throwers ) { | |
| 40 | 12 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | 69 | ▶ | *{$t} = sub { $throwers{$t}->throw(message => "$_[0]\n", @_[1..$#_]) }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 42 | } | ||
| 43 | |||
| 44 | 12 | 1; | |
| 45 | |||
| 46 | __END__ | ||