> -----Original Message-----
> From: David Freeman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 25, 2001 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: Whole Script, global symbol?
>
>
>
>
> 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.
These errors are cause by "use strict;". "use strict" is a very good thing,
so don't take it out. What you need to do is declare your variables in some
way. See:
perldoc strict
perldoc vars
perldoc my
perldoc our (perl 5.6 only)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]