But after playing through numerous attempts, I couldn't pull it off. I just figured you should be able to test the return of a sub this way, though I've never thought of trying it until now.my $num = 5; if (\&add($num) { .. } sub add { my $shift = shift; my $num2 = 10; my $sum = $num1 + $num2; if ($sum == "15") { return 1; } else { return 0; } }
In reply to Re^4: adding an IF to a push
by sulfericacid
in thread adding an IF to a push
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |