Hi guys, I'm Jack, it's my first time here and for my first post I ask for help. Not a nice way to start :D, and soon I hope to contribute to this forum. I'm try to convert this for a friend
#!/usr/bin/perl # # pwgen 1.0 # # Usage: pwgen [length] # # length - an optional argument indicating the length of the +password # # This will generate random passwords of the specified or default leng +th. # Requires the Perl package Math::Random::Secure to produce # cyptographically secure passwords. # # Copyright (C) 2012 - Paul E. Jones <paulej@packetizer.com> # Permission to use, copy, modify and distribute this software is gran +ted. # use strict; use Math::Random::Secure qw(irand); # Define the default password length $main::default_password_length = 12; # # GeneratePassword # # Description # This routine will generate a password and return it as a str +ing. # By default, it will not utilize special characters like "~" +in # passwords, but if the second argument is a 1, it will. Note + that # use of special characters provides only minimum additional s +trenth, # yet they are not very friendly for humans. For details, visi +t # https://secure.packetizer.com/pwgen/. # # Parameters # length [in] # The length of the password # special [in] # Indicates whether to use special characters other than # the letters A-Z, a-z, and digits 0-9. # # Returns # A string containing the password, or an empty string if ther +e # was an error producing the password. # sub GeneratePassword { my ($length, $special) = @_; my $password = ""; my @pwchars = ( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c +', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q +', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E +', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S +', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '~', '`', '!', '@', '#', '$', '% +', '^', '&', '*', '(', ')', '_', '+', '=', '-', '{', '}', '|', '\\', ' +]', '[', ':', '"', '\'', ';', '<', '>', '?', '/', '.' ); while($length > 0) { if ($special == 1) { $password .= $pwchars[irand(93)]; } else { $password .= $pwchars[irand(62)]; } $length--; } return $password; } # # MAIN # { my $password_length; # # Grab the requested password length from the command-line # if ($#ARGV == 0) { $password_length = $ARGV[0]; if (!($password_length > 0)) { $password_length = $main::default_password_length; } } else { $password_length = $main::default_password_length; } # We will not utilize special char print GeneratePassword($password_length,0) . "\n"; }
I'm noob, I admit. if someone is kind enough to compile and post it, I would be very grateful. Thank you in advance, Jack

Original contents restored above by GrandFather

Hi guys, I'm Jack, it's my first time here and for my first post I ask for help. Not a nice way to start :D, and soon I hope to contribute to this forum. I'm try to convert this for a friend
Code
I'm noob, I admit. if someone is kind enough to compile like Windows .exe and post it, I would be very grateful. Thank you in advance, Jack

In reply to Compile Perl To Executable by JackRoss

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.