Subject: | exporting dverify, using outside of main:: package |
first, thanks for a great module. it's certainly a great idea. you'll have to write a perl.com article about when you hit 1.0. i realize it's alpha ware and bugs are part of the playground. no worries. let me know if there is anything I can do to help. i tried to fix the package related stuff, but I'm not familiar enough with Error.pm.
dverify() is documented as an alternative to try/catch interface.
you do not have dverify() listed in the export, export_ok, or export_tags.
when calling the dverify() function as Data::Type::dverify() the following error is returned:
Can't call method "try" without a package or object reference at /usr/lib/perl5/site_perl/5.8.0/Data/Type.pm line 210.
finally, using try/catch blocks with a package name other than main (or main::main oddly enough) the catch block gets passed an empty Failure::Facet object instead of the Failure::Type object (which contains all data associated with the exception).
WORKING CODE
use Data::Type qw( :all );
use Error qw( :try );
use Data::Dumper;
try { verify('mike_web.oakley.com', EMAIL) }
catch Error with { print STDERR Dumper \@_ };
WORKING OUTPUT
$VAR1 = [
bless( {
'was_line' => 7,
'type' => bless( [
undef
], 'Facet::email' ),
'was_file' => './ryan.pl'
}, 'Failure::Type' ),
\0
];
FAILING CODE
package Bob;
use Data::Type qw( :all );
use Error qw( :try );
use Data::Dumper;
try { verify('mike_web.oakley.com', EMAIL) }
catch Error with { print STDERR Dumper \@_ };
FAILING OUTPUT
$VAR1 = [
bless( {}, 'Failure::Facet' ),
\0
];
FYI-
[guavas@kidcool Validate]$ uname -a
Linux kidcool 2.4.19-16mdk #1 Fri Sep 20 18:15:05 CEST 2002 i686 unknown unknown GNU/Linux
[guavas@kidcool Validate]$ perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi