Skip to content

Instantly share code, notes, and snippets.

@felipernb
Created August 27, 2012 08:20
Show Gist options
  • Select an option

  • Save felipernb/3486665 to your computer and use it in GitHub Desktop.

Select an option

Save felipernb/3486665 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
sub factorial {
my $n = $_[0];
if ($n <= 0) {
return 1;
}
return $n * factorial($n-1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment