×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Perl
Posted by: Ben Valentine
Added: Jan 6, 2017 3:49 PM
Modified: Jan 6, 2017 3:50 PM
Views: 10
Demonstrates two ways of retrieving arguments from a subroutine.
  1. sub volume {
  2.         my $height = shift;
  3.         my $width = shift;
  4.         my $depth = shift;
  5.  
  6.         return $height * $width * $depth;
  7. }
  8.  
  9. sub volume {
  10.         my ($height, $width, $depth) = @_;
  11.  
  12.         return $height * $width * $depth;
  13.     }