Skip to content

Instantly share code, notes, and snippets.

@aggrolite
Created February 27, 2012 22:32
Show Gist options
  • Save aggrolite/1927594 to your computer and use it in GitHub Desktop.
Save aggrolite/1927594 to your computer and use it in GitHub Desktop.
power
sub power {
my ( $base, $exponent ) = @_;
my $result = 1;
for ( my $i = 0 ; $i < $exponent ; $i++ ) {
$result = $result * $base;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment