Skip Menu |

This queue is for tickets about the Data-Type CPAN distribution.

Report information
The Basics
Id: 2333
Status: resolved
Priority: 0/
Queue: Data-Type

People
Owner: Nobody in particular
Requestors: sudoer [...] users.sf.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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
The upcoming Data:Type is under overhaul. The problem is solved and a test script passed already. I plan to release it as beta. Please do not invest any time into your old alpha, because it will be extreme incompatible with the new version. [Info] The flaw was due to piggy package names. Now everything is under Data::Type:: (also try/catch) and isn't broken when reexported or whatever. The old 'dverify' expected try+catch+with under 'main::' namespace. Also, in your Data::Type version i simply forgot to export 'dverify'. But don't waste your time tracking this problem down, because i assume the next CPAN relase this week. Thank you very much for your extreme valuable feedback ! I included your snippet as a test into the future versions. Greetings, Murat [guest - Thu Apr 3 02:12:41 2003]: Show quoted text
> 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 Show quoted text
> 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
Done.