Umm ... no offense meant toward sauoq,

Why would I take any offense?

but why embed that code in a script when you can use Crypt::GeneratePassword instead?

This is an old discussion. There are many reasons why one might choose to use a short piece of code instead of a module. And vice versa. In fact, many of them overlap. It's all a question of your priorities for the project at hand. Things to consider include maintainability, verifiability, deployability, development efficiency, run time efficiency, and compatibility among others. Even corporate culture can play a role.

But when it comes to creating applications, you don't have to reinvent wheels like that.

You're right, you don't. And CPAN is one of the most wonderful things about Perl. On the other hand, sometimes a custom built wheel fits better than a generic one. Fortunately, Perl gives us the tools to build those too. As for which is best, well, the only answer is: "it depends."

Lucky for us, Perl so often gives us the choice. :-)

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: (jeffa) 3Re: Creating random passwords? by sauoq
in thread Creating random passwords? by stonecolddevin

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.