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