W
wana
Here is a piece of code from a simple program I wrote to do some FTPing. I
was wondering if the form of my statement is acceptable with respect to the
use of 'and' and 'or'. I did it, hoping for the best, and it seems to
work. I am always shaky on rules of precedence and usually use lots of
()'s to make sure I get it right, but I am trying to wean myself off of
them.
if ($user and $pass)
{
$ftp->login($user, $pass)
and print "successfully logged on to $server as $user\n"
or print "problem logging on to $server as $user\n";
}
Thanks!
was wondering if the form of my statement is acceptable with respect to the
use of 'and' and 'or'. I did it, hoping for the best, and it seems to
work. I am always shaky on rules of precedence and usually use lots of
()'s to make sure I get it right, but I am trying to wean myself off of
them.
if ($user and $pass)
{
$ftp->login($user, $pass)
and print "successfully logged on to $server as $user\n"
or print "problem logging on to $server as $user\n";
}
Thanks!