If it works fine on everything but Mac NN6, and it works fine on Mac NN6 (but the Mac NN6 loading bar and spinner keep going), then it probably works fine.

Regarding your code:

This bit is silly:

#format site name for use with hashes $_ = $site; $_ =~ s/-//g; $_ =~ s/\.//g; my $username = $username{$_};

You don't need to get rid of characters like this to use hashes. You just need to put the hash key in quotes, if you are using it raw. E.g.

my %username = ( "site1.com" => "usernam1", "site2.com" => "usernam2", "site3.com" => "usernam3");

On a similar note, name => "$username" can just be  name => $username. You don't need to force string context, Perl does that for you automatically. Ditto elsewhere in the script.

Personally, I also think that using CGI just to print HTML results in an ugly mix of HTML and perl; but that is my idiosyncratic view.

Other than that... hmm. "finish". On the whole, I suspect it is good to have a single "normal" exit point for a script - which would be in the main body, not a subroutine - and a separate "error" exit. Initially, these may do the same things. But sooner or later you may want to e.g. log an error to a file or whatever, and "finish" won't let you do that because it doesn't distinguish between good and bad exits. But that is just my opinion, again.

dave hj~


In reply to Re: Exiting improperly, or NN6 error? by dash2
in thread Exiting improperly, or NN6 error? by fireartist

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.