> If this is really what your code looks like, with unused blocks and all,
> it's better written as:
>
>     if (   $add_alias && $add_destination && !$selection
>         && $add_alias       !~ /[^\w\.\-]/]
>         && $add_destination !~ /\@/
>     ) {
>         # ... code goes here ...
>     }

        no, actually the unused blocks were just there to make the
        reading a bit easier on the eyes. each if statement does have
        *something* in its block statement.

>
> Format to taste, of course.  Your checks on $add_alias, $add_destination,
> and $selection should also probably be checks for defined'ness, not truth.
> 0 is false, but, according to your definition of what $add_alias should
> contain, is also a valid value.
>

        i am not sure what you mean here. i am trying to check whether
        or not anything was filled in for these fields. i am grabbing
        $add_alias from the hash parsed by a form parsing subroutine.
        (the data is coming from a web page form)

>
> Also, in your current code you don't do any checks on your calls, such as
> your open and rename calls.  You should always check open, and usually check
> rename.
>

        i am not certain what you mean by 'checks on calls' either.
        point me in the right direction?

        thanks! -cjm

Reply via email to