if you are trying to use the warn in the case of a function call failure ... then something like this might work for you
function() || warn('error message') && warnFunction();
as illustrated here:
#!/usr/bin/perl -w
use strict;
sub doSomething() {
return(0);
}
sub warnFunction() {
print "Warn Function\n";
}
doSomething() || warn('called warn()',"\n") && warnFunction();
otherwise ... if you are just trying to test the value of a variable ... then use an 'if' as stated above.