Hey guys,
I'm relatively new to PERL, I know the basic syntax, but there's still a lot to learn for me.
I'm attempting to write a script that will print out a wordlist based on the "Brute-force principle". By that I mean that it will create a list of "words" in the format of
"0 1 2 3 4 5 6 7 8 9 and then continue to
00 01 02 03 04 05 06 07 08 09
10 11 12 13", and so on.
So far I have got the following script that creates the first line. The problem now is that I have absolutely no clue how to continue the script.
#!D:\Perl\bin\perl
use warnings;
use strict;
open my $outfile,">>", "words.txt";
my @word_characters = (0..9);
foreach my $character(@word_characters) {
print $outfile "$character\n";
}
close $outfile;
In the future, I plan to add a filter to only print those between 6 and 20 (f.ex. characters), but for now, I just want to get this working.
Please note that I do not want anyone to write the whole script for me, but if you would like to point me in he right directions, and maybe tell me what arguments to use, I would be very grateful ;-)
Thanks a lot.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.