I don't think anyone commented on why your script was not producing the desired results. The $2 value in the awk command (used to print the second column of input) was being interpreted by perl as a variable... thus you were passing awk '{print }' to the shell. Escaping the '$' would give you the desired results.
my $GATEWAY_ADDR=`netstat -r | grep ^default | awk '{print \$2}'`;