I think you mean:
if ($answer eq "add" || $answer eq "a") { &addlinks; } elsif ($answer eq "remove" || $answer eq "r") { &rmlinks; } else { exit 0; }
You're probably better off calling those as addlinks() and rmlinks() until you understand how the &sub calls are special (see perlsub).
Also, I recommend that you use strict; use warnings; until you know why you might not want strict and warnings.
In reply to Re: Subroutines within if statements
by kyle
in thread Subroutines within if statements
by muizelaar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |