First the others are right there is no real reason to complcate this with references a simple copy by value is fine here, and there is no need to redo what has been done...
Now looking at the question I have to say that I grabbed your code and stripped to the most simple form and tested it. It doesn't have the derefeencing problem you mention
($width, $height) = gifdim('test_text');
print "Height = $$height Width = $$width \n";
exit;
sub gifdim ($) {
my $filename = $_[0];
my $height =200;
my $width =300;
return \($width, $height);
}
output:Height = 200 Width = 300
So im not sure what problem you are having.