perl and not equal

Hi all

I have this script that i have written in some logging for but i do not want it to log for all option, i have used Getopt::Long 2.11 to allow differnt switches but i only want logging on one type of switch

this is my code but it does not like the ne (not equals)
i do not wnat the logging run if the -p is chosen

if ($OPT-> ne {p}){
# setup logging
    open (OUTF, ">> $log") or die "$PROG: cannot oprn log file: $log\n";
    chomp(my $date = `/bin/date '+%d/%m/%y %H:%M:%S'`);
    printf OUTF "$date : nvrm run from  %-3s by  %-5s \n", $ENV{HOST}, $ENV{USER};
    close OUTF;        

thanks

A

Try:

if (not defined $OPT->{p}){

that reported logging still for all options

thanks

Try this:

if (!defined($OPT{'p'})) {

use "exists" to test a hash

unless (exists $OPT{p})

i get this error

Global symbol "%OPT" requires explicit package name at ./nvrm line 81.
Execution of ./nvrm aborted due to compilation errors

%OPT? Is that a typo, or it's just reported differently?

nope not a typo

just how my shell is reporting it i think

here is it copied staight from the script

if (!defined($OPT{'p'})) {