in reply to How to execute perl script with options using Eclipse IDE?
Irrespective of any potential issues with Eclipse, your code most likely won't do what you want even when run from the normal command line.
GetOptions returns true if the arguments could successfully be parsed, so that's what you're testing in your subsequent if ($option) { ... }.
Maybe you meant to test if ($age) { ... } instead? But then you shouldn't initialize the variable with 24, because that's a true value, too... (likewise for $name, of course)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to execute perl script with options using Eclipse IDE?
by Divakar (Sexton) on Nov 29, 2011 at 10:07 UTC | |
by Eliya (Vicar) on Nov 29, 2011 at 10:26 UTC |