Two quick comments on the code:

There are two subtle problems with this statement:

require 5.6;
The first is that it will require perl v5.600.0 rather than v5.6.0, because 5.6 is a plain old number rather than a version string. The second is that it is executed at runtime, while you are using compile-time features of 5.6.0 such as our and the warnings pragma. Change that line to: use 5.006; to get the proper behavior in all versions of Perl.

Next, I'm confused by your constructor:

sub new { my $package = shift; my %attributes = %{ shift() }; my ($bot_name, $prefix, $server, $password, $port, $channel); $bot_name = $attributes{name}; $prefix = $attributes{prefix}; $server = $attributes{server}; $password = $attributes{password}; $port = $attributes{port}; $channel = $attributes{channel}; for ($bot_name, $prefix, $server, $password, $port, $channel) { die "Incomplete attribute list" unless $_; } convertAttributes( \%attributes ) or die "Attribute list malformatted"; bless { %botInfo }, $package; }
I can't figure out why you copy all those attributes out of the hash into lexical variables that go out of scope at the end of the subroutine anyway. If you want to verify the attributes, just do it directly on the hash values:
for (qw/ name prefix server password port channel /) { $attributes{$_} or die "Missing attribute '$_'"; }

And one important comment on the design:

There seems to be something seriously amiss with the design of this module. You've got an object constructor and object methods, but you're storing instance data in global variables (i.e. $bot and %botInfo)! What happens if you create two objects of this class? I'm not sure, but I expect it would be messy...

Currently, the interface and the implementation are not consistent. I think that's the first thing to work on for this module.


In reply to Re: A code review if you please (code) by chipmunk
in thread A code review if you please (code) by deprecated

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.