#!/usr/bin/env perl use strict; use warnings; use URI; my $uri = URI->new('https://dev.preview.com/oauth2/default/v1/authorize'); $uri->query_form( client_id => 'XXXXXXXXXXXXXXX', response_type => 'code', scope => 'openid', redirect_uri => 'http%3A%2F%2Ftestchandan.com%3A5001', state => '1234', nonce => 'UBGW' ); my $wanted = "https://dev.preview.com/oauth2/default/v1/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code&scope=openid&redirect_uri=http%3A%2F%2Ftestchandan.com%3A5001&state=1234&nonce=UBGW"; print "WANTED: $wanted\n"; print "FORMED: $uri\n\n"; print $uri eq $wanted ? "<>\n" : "<>\n";