are there any issues concerning using this code without the -T?
use strict; use warnings; use Net::Ping; use CGI qw/:standard/; my @hosts; if ( -e "ship.cfg" ) { open (CFGFILE, "ship.cfg") || die; @hosts=<CFGFILE>; close (CFGFILE); } else { # Enter your hosts here... @hosts = qw/host1 host2 host3/; } my @uphosts=(); my @downhosts=(); my $proto; my @verbage=("are", "hosts", "are", "hosts"); my $p = Net::Ping->new('udp'); foreach my $host(@hosts) { chomp($host); if ($p->ping($host)) { push (@uphosts, $host); } else { push (@downhosts, $host); } } $p->close(); print start_html,br; print header,br; print start_form,br; print submit('Refresh'),p; if (scalar(@downhosts) == 1 ) { $verbage[2]="is"; $verbage[3]="host" } if (scalar(@uphosts) == 1 ) { $verbage[0]="is"; $verbage[1]="host"; } unless (scalar(@downhosts) == 0) { print p,"There $verbage[2] ",scalar +(@downhosts)," $verbage[3] down",br } print "There $verbage[0] ",scalar(@uphosts)," $verbage[1] alive",br; print p,"The following $verbage[1] $verbage[0] alive: \n",br; foreach my $uitem (sort @uphosts) { print li("$uitem"),br; } unless (scalar(@downhosts) == 0) { print p,"The following $verbage[3] +$verbage[2] down: ",br } foreach my $ditem (sort @downhosts) { print li("$ditem"),br; }

In reply to using -T doesn't work by tcf03

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.