#!/usr/bin/perl -wT use strict; use CGI qw(header param); # Assume your form inputs are called ip1 and ip2 my (@ips) = (param('ip1'), param('ip2'); # Untaint the IP data # Note: This is very 'quick and dirty', and [mirod]'s # solution below is much better. foreach (@ips) { s/^(\d+\.\d+\.\d+\.\d+).*$/$1/; } # print HTTP header print header(-type => 'text/plain'); # Call BING (I'm guessing at the syntax) # and print the output print qx(BING $ips[0] $ips[1]);