Closed tobyink closed 3 years ago
my $ua = 'HTTP::Tiny'->new; my $res = $ua->get('hxxps://example.com/');
This produces the following warning:
Use of uninitialized value in numeric eq (==)
And it returns a response saying that the request resulted in an internal error.
A response saying that the request resulted in an internal error but no visible warning.
This is because of a comparison $port == $DefaultPort{$scheme} and $DefaultPort{$scheme} is undef because there's no such key.
$port == $DefaultPort{$scheme}
$DefaultPort{$scheme}
no warnings qw( uninitialized numeric );
Example
Current Behaviour
This produces the following warning:
And it returns a response saying that the request resulted in an internal error.
Expected Behaviour
A response saying that the request resulted in an internal error but no visible warning.
Explanation
This is because of a comparison
$port == $DefaultPort{$scheme}
and$DefaultPort{$scheme}
is undef because there's no such key.Possible Solution
no warnings qw( uninitialized numeric );