Skip to content

Instantly share code, notes, and snippets.

@KamilaBorowska
Created March 28, 2012 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KamilaBorowska/2229028 to your computer and use it in GitHub Desktop.
Save KamilaBorowska/2229028 to your computer and use it in GitHub Desktop.
ACME::Square
package ACME::Square;
use strict;
use warnings;
use Carp;
use Exporter;
use base 'Exporter';
our $VERSION = 20120328;
our @EXPORT_OK = qw( square );
sub square ($) {
my ($a) = @_;
return $a * $a;
}
1 or croak 'Failed to give positive value.';
__END__ or croak 'Failed to run __END__ before documentation.';
=head1 NAME
ACME::Square - A module for your squaring needs.
=head1 SYNOPSIS
use ACME::Square qw(square);
print square(3); # 9
=head1 DESCRIPTION
This is procedural module which squares first argument. It even can square
float numbers, unlike simple implementation in C++ which usually would use
C<char> for storing data.
=head2 Functions
This module can give following functions on request.
=head3 square
print square(3);
Prints square of the given number. Note that this module inserts alias of
C<$value ** 2> to your code to help you squaring numbers. This doesn't use
filters, so it should be safe.
=head1 LICENSE
This module is in Public Domain. Seriously, I don't care about this piece of
garbage.
=head1 BUGS
If you will give this function string, you will get warning. This will be
fixed in next release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment