#! /usr/bin/perl -w # # mkprofile.pl - # generate a formatted profile based on passed in arguments # # Gawd, I hate writing perl. It shows, too. # my $__VERSION__='$Id: mkprofile.pl 5923 2005-12-14 18:49:16Z steve $'; use strict; use Getopt::Long; my $help = ''; my $nowarn = ''; my $escape = ''; my %output_rules; my $hat = "__no_hat"; my %flags; GetOptions( 'escape|E' => \$escape, 'nowarn' => \$nowarn, 'help|h' => \$help, ); sub usage { print STDERR "$__VERSION__\n"; print STDERR "Usage $0 [--nowarn|--escape] execname [rules]\n"; print STDERR " $0 --help\n"; print STDERR " nowarn: don't warn if execname does not exist\n"; print STDERR " escape: escape stuff that would be treated as regexs\n"; print STDERR " help: print this message\n"; } &usage && exit 0 if ($help || @ARGV < 1); sub emit_netdomain { my $rule = shift; # only split on single ':'s my @rules = split (/(?