There are several special characters that PERL uses to perform specific functions, such as @ (at), $ (dollar sign), ” (double quote). Internal Server Errors will definitely occur if you have an unescaped @ or ” in your variable definition. (An unescaped $ within a variable definition or subroutine usually will not cause Internal Server Error, but may make your program behave contrary to the way you want.)
As PERL reads through the script, it will look for these characters and try to execute a command based on it. As you may already know, the @ is used to define arrays, the $ is used to define variables, and the ” is used to enclose variable definitions. For this reason, if you want to use any of these symbols within your variable definitions, you have to “escape” them.
Escaping is simply adding a backslash before the special character like this:
me\@mydomain.com
-and-
He said, \”I really need to escape that quotation mark.\”
So, your final variable definition will look like:
$orgemail=”me\@myisp.com”;
-and-
$a_useless_message=”He said, \”I really need to escape that quotation mark.\””;
Not escaping these special characters will cause an error in your program when you try to run it.
Alternatively, you can change the ” ” surrounding your variable definition to ‘ ‘, which means that your variable definition will be taken literally instead of attempting to process a function.
Example:
$test = “this will produce @n error”;
$test = ‘this will not produce @n error’;
$test = “this will not produce \@n error”;