in reply to I just want IF, OR, OR not every one

Without seeing some sample input data and your desired output, I'm not sure anyone can help you here. Your question is basically incoherent without that.

Can someone explain to me how if works?

It's pretty simple. Does this code make sense?

sub print_if_true { my $value = shift; if ($value) { print "Value '$value' is true!\n"; } } print_if_true( 1 ); print_if_true( 0 );

Now if you throw an else block in there, things should still make sense:

sub print_if_true { my $value = shift; if ($value) { print "Value '$value' is true!\n"; } else { print "Value '$value' is false!\n"; } }

I hope that makes sense. There's one thing that you should also know.

sub print_if_true { my $value = shift; if ($value) { print "Value '$value' is true!\n"; } else { print "Value '$value' is false!\n"; } print "This always prints.\n"; }

If any of this is surprising, then please let us know so that we can explain it. I think things will make sense for you in your program when you understand this.