BTW, why don't you use a plain old module? I don't see any reason to OO here.
package NCS::PuppetDB::Data { use strict; use warnings; use JSON::Tiny qw(decode_json encode_json); use Net::Curl::Easy qw(:constants); use Exporter qw( import ); our @EXPORT_OK = qw( getHosts getHostFacts getFact); our $VERSION = '0.5.3'; sub getHosts { ... } sub getHostFacts { ... } sub getFact { ... } 1; }
Please correct me if i miss something. I added some of my favorite modules. No need to shell out for curling etc.
Update: But perhaps this layout is interesting for you:
package NCS::PuppetDB::Data { use Role::Tiny; use JSON::Tiny qw(decode_json encode_json); use Net::Curl::Easy qw(:constants); use feature qw(say); say q(package ) . __PACKAGE__; sub getHosts { ... } sub getHostFacts { ... } sub getFact { ... } 1; }
package BlueCowdawg { use Class::Tiny; use Role::Tiny::With; use feature qw(say); with qw(NCS::PuppetDB::Data); say q(package ) . __PACKAGE__; 1; }
#!/usr/bin/env perl use strict; use warnings; use Try::Tiny; use BlueCowdawg; use feature qw(say); say q(package ) . __PACKAGE__; my $fido = BlueCowdawg->new(); try { say $fido->getHosts(); } catch { warn $_; }; try { say $fido->getHostFacts(); } catch { warn $_; }; try { say $fido->getFact(); } catch { warn $_; }; __END__
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re: Need a second set of eyes: Very odd failure
by karlgoethebier
in thread Need a second set of eyes: Very odd failure
by blue_cowdawg
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |