#!/usr/bin/perl
use strict;
use warnings;
use Memory::Usage;

if( scalar @ARGV < 1 ) {
	die "Usage: $0 Module::Name\n";
}

my $m = Memory::Usage->new();
$m->record('Base perl plus Memory::Usage');
foreach my $module_name (@ARGV) {
	eval "use $module_name";
	warn $@ if $@;
	$m->record("after 'use $module_name'");
}

$m->dump();

__END__

=head1 NAME

module-size -- Spit out estimated size of module code.

=head1 SYNOPSIS

    module-size Some::Module::Name [ Other::Module ]

=head1 DESCRIPTION

Reports the process size after 'use'ing a module.  If more than one module name
is provided, the modules are included in order, allowing you to compare (for
example) the incremental effect of adding other modules to an existing
application.

=head1 SEE ALSO

L<Memory::Usage>, 

=head1 LICENCE AND COPYRIGHT

Copyright 2010 Dave O'Neill.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

=cut
