2021年3月24日星期三

How to Run From .txt File?

I'm trying to get data from base58 combination by appending to the end of strings.

#!c:\perl64\bin\perl.exe     {$db = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";  $pw="Rw5cfDTA8zGsdjEhKnhXJTH7LrciGrDi9qZ1";  @delen = split('',$pw);  @letters = split('',$db);  $length = length($pw);  for ($position = 36; $position < $length+1; $position++)  {foreach(@letters)      {          @new = @delen;          splice(@new, $position, 0, $_);          print join('',@new)."\n";      }}}  

I have to enter all the combinations one by one in the $ pw definition. Instead of entering it manually, I want it to process all lines of my list in the TXT file. I did some research on how to do it but failed.

EDITING:

I found the method I mentioned above, it will be exactly like this. However, I have a different problem. When I run the Perl file, the outputs are sequenced badly. I think there's a problem getting from the input file

#!c:\perl64\bin\perl.exe    open( my $data, "<", "test.txt" ) or die "There was a problem opening: $!";    while ($data) {      {          my $db = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";          my $pw = <$data>;          my @delen   = split( '', $pw );          my @letters = split( '', $db );          my $length  = length($pw);          for ( my $position = 35 ; $position < $length + 1 ; $position++ ) {              foreach (@letters) {                  my @new = @delen;                  splice( @new, $position, 45, $_ );                  print join( '', @new ) . "\n";                }          }      }  }  
https://stackoverflow.com/questions/66790724/how-to-run-from-txt-file March 25, 2021 at 07:11AM

没有评论:

发表评论