in reply to Weird eq behaviour


There shouldn't be any difference in this case. The operators eq and =~ have different precendence but they are both higher than ||
my $from = '<>'; my $to = '<>'; if (!$from || !$to || $from eq "<>" || $to eq "<>" ) {print "Ok 1\n +"} if (!$from || !$to || $from =~ /^<>$/ || $to =~ /^<>$/) {print "Ok 2\n +"} __END__ Prints: Ok 1 Ok 2

--
John.

Replies are listed 'Best First'.
Re: Re: Weird eq behaviour
by Cine (Friar) on Jul 25, 2002 at 12:51 UTC
    Well I would agree with you except for the simple fact that I had an email, for which I had to add the regexp aswell to my script because it die in the next lines trying to parse "<>"...

    T I M T O W T D I