Could some one help me with this code. Every time that I this code:

 

use Net::Whois; 

use Carp;

$dom ="digidyne.com";

my $w = new Net::Whois::Domain $dom or die "Can't connect to Whois
server\n;

 unless ($w->ok) { croak "No match for $dom";}

 print "Domain: ", $w->domain, "\n";

 print "Name: ", $w->name, "\n";

 print "Tag: ", $w->tag, "\n";

 print "Address:\n", map { "    $_\n" } $w->address;

 print "Country: ", $w->country, "\n";

 print "Name Servers:\n", map { "    $$_[0] ($$_[1])\n" }

 @{$w->servers};

 my ($c, $t);

 if ($c = $w->contacts) {

   print "Contacts:\n";

   for $t (sort keys %$c) {

     print "    $t:\n";

     print map { "\t$_\n" } @{$$c{$t}};

   }

 }

 print "Record created:", $w->record_created ;

 print "Record updated:", $w->record_updated ;

 

 

 

I get the following error:

 

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 4, near "unless ($w->ok) { croak "No"

  (Might be a runaway multi-line "" string starting on line 3)

        (Do you need to predeclare unless?)

String found where operator expected at C:\testScripts\testwhois.pl line
5, near "print ""

  (Might be a runaway multi-line "" string starting on line 4)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 5, near "print "Domain"

        (Do you need to predeclare print?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 5, near "", $w->domain, "\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
6, near "print ""

  (Might be a runaway multi-line "" string starting on line 5)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 6, near "print "Name"

        (Do you need to predeclare print?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 6, near "", $w->name, "\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
7, near "print ""

  (Might be a runaway multi-line "" string starting on line 6)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 7, near "print "Tag"

        (Do you need to predeclare print?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 7, near "", $w->tag, "\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
8, near "print ""

  (Might be a runaway multi-line "" string starting on line 7)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 8, near "print "Address"

        (Do you need to predeclare print?)

String found where operator expected at C:\testScripts\testwhois.pl line
8, near "n", map { ""

Scalar found where operator expected at C:\testScripts\testwhois.pl line
8, near "", map { "    $_"

        (Missing operator before     $_?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 8, near "$_\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
9, near "print ""

  (Might be a runaway multi-line "" string starting on line 8)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 9, near "print "Country"

        (Do you need to predeclare print?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 9, near "", $w->country, "\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
10, near "print ""

  (Might be a runaway multi-line "" string starting on line 9)

        (Missing semicolon on previous line?)

Bareword found where operator expected at C:\testScripts\testwhois.pl
line 10, near "print "Name"

        (Do you need to predeclare print?)

String found where operator expected at C:\testScripts\testwhois.pl line
10, near "n", map { ""

Scalar found where operator expected at C:\testScripts\testwhois.pl line
10, near "", map { "    $"

        (Missing operator before     $?)

Backslash found where operator expected at C:\testScripts\testwhois.pl
line 10, near ")\"

        (Missing operator before \?)

String found where operator expected at C:\testScripts\testwhois.pl line
14, near "print ""

  (Might be a runaway multi-line "" string starting on line 10)

        (Missing semicolon on previous line?)

syntax error at C:\testScripts\testwhois.pl line 4, near "unless
($w->ok) { croak "No match "

Execution of C:\testScripts\testwhois.pl aborted due to compilation
errors.

 

 

Could some one tell me what I am doing wrong. 

 

Thank you,

Thomas 

 

Reply via email to