Perl module for efficient resampling