void has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Crypt::RC4; use Getopt::Std; system('clear'); getopts('ed:', \%opts); if ($opts{e}) { print "Enter Passphrase: "; chomp ($passphrase = <stdin>); print "Enter Plaintext: "; chomp ($plaintext = <stdin>); $encrypted = RC4 ( $passphrase, $plaintext ); $passphrase = ""; print "Enter the file name to save to:"; chomp ($filename = <stdin>); print "Encrypting........\n"; open(FILE,">$filename"); print FILE $encrypted; close FILE or die "There was an error closing the file\n"; } elsif ($opts{d}) { print "option e not used\n"; } else{ print "Use -e to encrypt or -d to decrypt\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GetOpts problem..........I think.........
by rchiav (Deacon) on Sep 07, 2001 at 22:57 UTC | |
by void (Scribe) on Sep 07, 2001 at 23:16 UTC |