in reply to if not defined

Sure. You have a choice of:

! defined

which is high precedence, or

not defined

which is low precedence. If you don't want to have to think about precedence, just use loads of brackets.

You can read more about this in: perlop.

By the way, you mention CGI: it doesn't make any difference whether the Perl script is being used for a website (CGI), or not. The language remains the same.

Hope that helps, andye