in reply to Subroutines within if statements
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutines within if statements
by lodin (Hermit) on Feb 21, 2008 at 23:48 UTC | |
|
Re^2: Subroutines within if statements
by wfsp (Abbot) on Feb 22, 2008 at 08:45 UTC | |
by kyle (Abbot) on Feb 22, 2008 at 13:55 UTC | |
|
Re^2: Subroutines within if statements
by muizelaar (Sexton) on Feb 22, 2008 at 11:03 UTC |