1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl # I valori da sommare vengono indicati come costanti. $input_1 = 4; $input_2 = 7; sub somma { return ($_[0] + $_[1]); } $totale = &somma ($input_1, $input_2); print "$input_1 + $input_2 = $totale\n";
1
4 + 7 = 11