|P is for Practical|
Net::FTP & if statement behaviorby alienhuman (Pilgrim)
|on Jan 02, 2002 at 22:44 UTC||Need Help??|
alienhuman has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Net::FTP to great effect, however I've recently found some very strange behavior when I put a ftp method call into an if statement.
The following method returns the value "1" when it is successful, as described in the perldoc, and evidenced in this snippet from the debugger...
However, the same method call inside an if statement doesn't evaluate TRUE... which is not at all what I expected...
Why doesn't this if( $ftp->cwd( ... ) ); evaluate to true, if the value returned by $ftp->cwd is 1?