I modified the script to reflect what was suggested to me earlier, and now
when i run it, i receive errors telling me i'm missing something at line 11
regarding global symbols for my variables?
this is the whole script, nothing left out, if it's missing something
declared i'm not familiar enough with perl to know what that might be yet.
suggestions appreciated.
#!/usr/bin/perl -w
#Script to add e-mail address or domain name to /etc/mail/access file
#if it was not already listed.
use strict;
#use warnings;
open(NAMES,"/etc/mail/access") || die "Can't open access: $!\n";
while (<NAMES>){
( $email, $action )= split(/\t/);
$newarray{$email} = $action;
}
close NAMES;
if( exists $newarray{$email} ){
print $newarray{$email}, "\n";
}else{
print "How you wanna handle this one? ";
my $action;
chomp( $action = <STDIN> );
$newarray{$email} = $action;
}
~
Global symbol "$email" requires explicit package name at spamadd02.pl line 11.
Global symbol "$action" requires explicit package name at spamadd02.pl line 11.
Global symbol "%newarray" requires explicit package name at spamadd02.pl
line 12.
Execution of spamadd02.pl aborted due to compilation errors.
David M.R. Freeman
webmaster sysadmin for MMP, Inc.
web: www.woodfreeman.com
e-mail: [EMAIL PROTECTED]
phone: (253) 564-5902
fax: (253) 565-1811