View Single Post
Old Aug 18th, 2005, 10:48 AM   #3
sykkn
Hobbyist Programmer
 
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5 sykkn is on a distinguished road
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.
__________________
[ [ SykkN alloc ] initWithThePowerTo: destroyYouAll ];
/* Don't make me use it! */
sykkn is offline   Reply With Quote