Your script is erroring out for some reason, and it might be because you
never defined $my_addr.

$p->bind($my_addr) Sets the source address from which pings will be
sent. This must be the address of one of the interfaces on the local
host. $my_addr may be specified as a hostname or as a text IP address
such as "192.168.1.1".

Try the above, and if that doesn't work, run the script from the command
line and copy and paste the error message you get.

Also, you may want to add this line somewhere near the top of your
script since you are running it as a CGI:

Print "Content-type: text/plain\n\n";

Steven Kreuzer
Linux Systems Administrator
Etagon, Inc
W: 646.728.0656
F: 646.728.0607
E: [EMAIL PROTECTED]


-----Original Message-----
From: Mr. W. A. Khushil Dep [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 15, 2003 10:35 AM
To: [EMAIL PROTECTED]
Subject: Server Errors

I've got the below script saved on my server - but every time I use it I
get an Internel Server Error! I've set the permission to 755 but still
no
luck. Any ideas folks?

www.klconsulting.co.uk/cgi-bin/cssc.pl


#!/usr/bin/perl
use Net::Ping;

@host_array =
("192.153.1.10","192.153.0.18","212.241.168.197","212.241.168.138","212.
241.167.11","194.153.21.68","194.153.20.100","194.153.20.51","194.153.20
.52","194.153.20.53","515.35.226.5","212.241.160.12","194.153.1.19","194
.153.1.18","212.35.224.125","212.35.224.126");

$p = Net::Ping->new("icmp");

$p->bind($my_addr);

foreach $host (@host_array)
    {
       print "$host is ";
       print "NOT " unless $p->ping($host, 2);
       print "reachable.\n";
       sleep(1);
    }

$p->close();
 


======================================== 
W. A. Khushil Dep
Technical Support Agent
PIPEX Communications Plc
========================================
Phone  : 0845 077 83 24
Fax    : 08702 434440 
WWW    : www.pipex.net/support 
========================================

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. Although PIPEX Internet Limited operates
anti-virus programs, it does not accept responsibility for any damage
whatsoever that is caused by viruses being passed. If you suspect that
the message may have been intercepted or amended, please call the
sender.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
zentara
Sent: 15 December 2003 15:16
To: [EMAIL PROTECTED]
Subject: Re: pass vars to sub via TK/Button

On Mon, 15 Dec 2003 12:27:34 +0100, [EMAIL PROTECTED] (Oliver
Schaedlich) wrote:

>Greetings, 
>
>I'd like to know how to pass variables fetched by TK/entry to a
>subroutine by using a Button. The Button/-command line in the
>following script is obviously wrong, but should suffice to illustrate
>what I want it to do.
>
>I'd be happy if someone could tell me how to do this properly.

#!/usr/bin/perl
use strict;
use Tk;

my $main = MainWindow->new;

my $var1 = $main -> Entry( -width => 30 );
                             $var1 -> pack;
my $var2 = $main -> Entry( -width => 30 );
                             $var2 -> pack;

$main -> Button
    ( -text => 'Add',
      -command => sub{\&add_item($var1,$var2)}
    ) -> pack;

MainLoop;

sub add_item {
   my (@widgets) = @_;
   print "@widgets\n";
   my $entry1 = $_[0]->get();
   my $entry2 = $_[1]->get();
   print "Added->$entry1 + $entry2 = ",$entry1+$entry2,"\n";
return;
}
__END__

--
When life conspires against you, and no longer floats your boat,
Don't waste your time with crying, just get on your back and float.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to