#!/usr/bin/perl -w
# $Id: factorial.pl,v 1.1.1.1 2008/10/12 04:05:34 alamos Exp $

# This enforces strict syntax, including 
# mandatory declarations
use strict;

# This function computes the factorial of a number
sub factorial {
    my $n = $_[0];
    return 1 if $n == 0;
    $n * factorial($n - 1);
}

# Print 5!
print &factorial(5), "\n";
