Haineko::E - Convert error message to an object
Haineko::E provide methods for converting an error message of perl such as "error at /path/to/file.pl line 2." to an object.
use Haineko::E; eval { die 'Nyaaaaaaa!!!!' }; my $e = Haineko::E->new( $@ );
new() is a constructor of Haineko::E
use Haineko::E; eval { die 'Hardest' }; my $e = Haineko::E->new( $@ ); print $e->file; # /path/to/file.pl print $e->line; # 2 print for @{ $e->mesg }; # Hardest
message() returns whole error message as a text (scalar value).
use Haineko::E; eval { die 'Hard 2' }; my $e = Haineko::E->new( $@ ); print $e->message; # Hard 3 at /path/to/file.pl line 2.
text() returns error message part only.
use Haineko::E; eval { die 'Hard 3' }; my $e = Haineko::E->new( $@ ); print $e->text; # Hard 3
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.