Hi Monks,
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.
To wit:
The following method returns the value "1" when it is successful, as described in the perldoc, and evidenced in this snippet from the debugger...
DB<2> print $ftp->cwd( $whole ); Net::FTP=GLOB(0x47dbf4)>>> CWD /web Net::FTP=GLOB(0x47dbf4)<<< 250 CWD command successful. 1
However, the same method call inside an if statement doesn't evaluate TRUE... which is not at all what I expected...
DB<3> print if( $ftp->cwd( $whole ) ); Net::FTP=GLOB(0x47dbf4)>>> CWD /web Net::FTP=GLOB(0x47dbf4)<<< 250 CWD command successful. DB<4>
Why doesn't this if( $ftp->cwd( ... ) ); evaluate to true, if the value returned by $ftp->cwd is 1?
Thanks,
Chris
In reply to Net::FTP & if statement behavior by alienhuman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |