my $url = "https://url../GetDeviceInfo"; if( ... whatever condition ...) { $url .= "&active=true"; } say "Requesting $url"; my $output = `curl -s -k -u admin:password "$url"`; ...