Help for this page

Select Code to Download


  1. or download this
    my %service = qw(
        0050    www
    ...
    );
    my $match_lst = join "|", keys %service;
    my $match = qr/:($match_lst)\s/;
    
  2. or download this
    foreach my $line (grep /\b01\s/, `cat /proc/net/tcp`  ) {
        ++$count{$service{$1}} while $line =~ /$match/g;
    }