Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Läser varje rad i specifik fil och konverterar den till en MD5-hash.
- #Printar ut HASHET och tecknet/ordet i följande form "MD5 = "@ORD"
- #Skriver en fil med hashet>ordet istället för 'print'
- #use strict; not now in 1.1
- #use Getopt::Std; -||-
- #my %options=();
- #getopts("h:j:l:", \%options);
- #print "-h $options{h}\n" if defined $options{h};
- #print "-j $options{j}\n" if defined $options{j};
- #print "-l $options{l}\n" if defined $options{l};
- use Digest::MD5;
- print ("name of the file in curdir?: ");
- $file = <>;
- open(INFO, $file) or die ("The $file does NOT exist.\n"); #VAR :D
- foreach $line (<INFO>) {
- $md5 = Digest::MD5->new;
- $md5->add ($line);
- $digest = $md5->hexdigest;
- open OUTPUT, ">>output.txt";
- print OUTPUT "$digest = $line";
- if ($digest =~ s/A/O/) {
- #print ("$digest = $line"); <-- en if-sats kan vara NULL om det är ett argument?
- }
- }
- close(INFO);
- close OUTPUT;
Add Comment
Please, Sign In to add comment