Help for this page

Select Code to Download


  1. or download this
    my @commands = qw(ping traceroute whois other stuff);
    print $q->start_form(-method=>'POST',-action=>'formDB.cgi');
    print $q->hidden(-name=>'val',-value=>"$ciccio[2]");
    print $q->submit(uc($_)) foreach (@commands);
    print $q->end_form;
    
  2. or download this
    my $dispatch = {
        ping => sub { return my_ping($_[0])},
    ...
    foreach (@commands) {
      $dispatch->{$_}->($q->param('val')) if (defined $q->param(uc($_)));
    }