my $ref = \$data; size($ref); # will give you the same size of $data my $ref = \$data; my $ref2 = \$ref; size($ref2); # will give you the size of the reference itself