in reply to Question about warn statement

Try something like this:
open(FILE,">temp") || (warn "error message" and ($x = 1));
Update: Changed code to avoid wierd issue

Replies are listed 'Best First'.
Re: Re: Question about warn statement
by wirrwarr (Monk) on Aug 22, 2003 at 16:15 UTC
    This is dangerous:
    open(FILE,"<temp") || (($x = 1) && warn "error message1: $x"); open(FILE,"<temp") || (($x = 0) && warn "error message2: $x"); __END__ error message1: 1 at test-a.pl line 1.