in reply to Why am I getting "syntax error at Funcy.pl line 18, near "$barney return" ?
You're missing a semicolon on the line my $sum = $fred * $barney.
Update: Also, note that since return will return from the sub, the if won't get executed. And I'm not sure why your if blocks only have one variable in them - if you're trying to return either one or the other value, don't use an if, use the Conditional Operator ?:, as in ( $fred > $barney ? $fred : $barney ).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why am I getting "syntax error at Funcy.pl line 18, near "$barney return" ?
by prospect (Acolyte) on Jul 24, 2017 at 08:42 UTC | |
by Laurent_R (Canon) on Jul 24, 2017 at 09:00 UTC | |
by prospect (Acolyte) on Jul 24, 2017 at 09:06 UTC |