http://www.perlmonks.org?node_id=948838


in reply to DNS Lookup

Change:
$userinput = $name;
to:
$name = $userinput;

I think you were missing the warning that I see because your shebang line is messed up (add a space before the -w), and you are probably bypassing it anyway by invoking your script with the perl executable on the command line. Also add:

use warnings;
use strict and warnings

The same goes for $userinput = $ip;

Replies are listed 'Best First'.
Re^2: DNS Lookup
by JavaFan (Canon) on Jan 19, 2012 at 22:24 UTC
    you are probably bypassing it anyway by invoking your script with the perl executable on the command line.
    Perl actually honors command line switches on the she bang line, even when invoked directly:
    $ cat xxx #!/usr/bin/perl -w print undef; $ perl xxx Use of uninitialized value in print at xxx line 3.

      Yes, for the most part :)

      $ perl #!/usr/bin/perl -Mstrict -- Too late for "-Mstrict" option at - line 1.
Re^2: DNS Lookup
by jaldama (Acolyte) on Jan 19, 2012 at 20:05 UTC
    Ahh, life makes sense again.