#! /usr/bin/perl -w use diagnostics; use strict; use Getopt::Std; use Crypt::CBC; getopt( 'kio', \%opts ); $cipher = Crypt::CBC->new( -key => '$opts{"k"}', -cipher => 'Skipjack', ); $INFILE = %opts{"i"}; $OUTFILE = %opts{"o"}; open < INFILE or die "can't open $INFILE: $!"; open > OUTFILE or die "can't open $OUTFILE: $!"; read INFILE, $plaintext; $chipertext = $cipher->encrypt($plaintext); print OUTFILE, $chipertext; close OUTFILE; close INFILE; return (0);
Global symbol "%opts" requires explicit package name at skipjack.pl.td +y line 8. Global symbol "$cipher" requires explicit package name at skipjack.pl. +tdy line 10. Global symbol "$INFILE" requires explicit package name at skipjack.pl. +tdy line 14. Global symbol "%opts" requires explicit package name at skipjack.pl.td +y line 14.syntax error at skipjack.pl.tdy line 14, near "%opts{" Execution of skipjack.pl.tdy aborted due to compilation errors (#1) (F) You've said "use strict vars", which indicates that all variab +les must either be lexically scoped (using "my"), declared beforehand +using "our", or explicitly qualified to say which package the global var +iable is in (using "::"). Uncaught exception from user code: Global symbol "%opts" requires explicit package name at skipja +ck.pl.tdy line 8. Global symbol "$cipher" requires explicit package name at skipjack.pl. +tdy line 10. Global symbol "$INFILE" requires explicit package name at skipjack.pl. +tdy line 14. Global symbol "%opts" requires explicit package name at skipjack.pl.td +y line 14.syntax error at skipjack.pl.tdy line 14, near "%opts{" Execution of skipjack.pl.tdy aborted due to compilation errors.
UPDATE:
After following your instructions, i now have a working script. Thankyou
In reply to Skipjack Encryption by shadowoflinux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |