Advertisement
Guest User

Perl Wordlist Generator

a guest
Apr 7th, 2010
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.49 KB | None | 0 0
  1. #! /usr/bin/perl
  2.  
  3. use warnings;
  4.  
  5. print "How many characters to use: ";
  6. chomp($how_many = <STDIN>);
  7.  
  8. print "Which characters to use: ";
  9. chomp($characters = <STDIN>);
  10.  
  11. print "Enter filename to save to:";
  12. chomp($filename = <STDIN>);
  13.  
  14. open $fh, '>', $filename;
  15.  
  16. sub doIt {
  17.     my $i;
  18.     if($_[1] eq 0) {
  19.         print $fh $_[0]."\n";
  20.     }
  21.     else {
  22.         for($i=0; $i le length($characters)-1; $i++) {
  23.             doIt($_[0].substr($characters, $i, 1), $_[1]-1);
  24.         }
  25.     }
  26. }
  27.  
  28. doIt("", $how_many);
  29.  
  30. close($fh);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement