in reply to subroutines problem
sub add{ shift(@_) + (@_? add(@_):0) } #Test the "add" routine .. print add(qw/3 0 0 1 0 1 01 1 1 1 1 0 1 /); # Outputs : # 11
"Income tax returns are the most imaginative fiction being written today." -- Herman Wouk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutines problem
by newly (Initiate) on Jul 20, 2005 at 23:14 UTC | |
by NetWallah (Canon) on Jul 21, 2005 at 04:23 UTC |