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:

NCS/PuppetDB/Data.pm

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; }

BlueCowdawg.pm

package BlueCowdawg { use Class::Tiny; use Role::Tiny::With; use feature qw(say); with qw(NCS::PuppetDB::Data); say q(package ) . __PACKAGE__; 1; }

run.pl

#!/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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.