Help for this page

Select Code to Download


  1. or download this
    my (@hosts, @uphosts, @downhosts);
    
    if ( -e "ship.cfg" ) {
            open (CFGFILE, "ship.cfg") || die $!;
    
  2. or download this
            while (my @TMP=<CFGFILE>) {
    
  3. or download this
            # while (<CFGFILE>) {
    
  4. or download this
            # while (defined(my $line = <ARGV>)) {
            #     ...
            # }
    
  5. or download this
                    #if ( $_ =~ /^#/ ) { next }  # commented out in the OP
    
  6. or download this
                    foreach $_(@TMP) {
    
  7. or download this
                            if ($_ =~ /^([\w.]+)$/) {
    
  8. or download this
                                    $_ = $1;
    
  9. or download this
                                    push (@hosts, $1);
                            } else {
                                    next;
                            }
    
  10. or download this
            close (CFGFILE);
    
  11. or download this
    # Just cleaning up the verbage is are host hosts etc...
    if (scalar(@downhosts) == 1 ) {
    ...
            $verbage[0]="is";
            $verbage[1]="host";
    }
    
  12. or download this
    # We don't care about things that don't exist...
    unless (scalar(@downhosts) == 0) { print p,"There $verbage[2] ",scalar