#!/bin/env perl use strict; use warnings; use strict; use 5.010; use local::lib './lib'; use Net::DNS; use Test::LeakTrace; die("ERROR: Please provide Loop count > 0 as first argument") unless $ARGV[0]; leaktrace { for (1..$ARGV[0]) { my $res = Net::DNS::Resolver->new; my @mx = mx($res, "example.com"); } } ; #### for iterations in 1 2 3 4 5 6 7 8 9 10; do perl script.pl $iterations 2>&1 | wc -l; done #### 1374 1492 1612 1736 1859 1982 2106 2229 2353 2477