Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w print "Please input ldap file: "; chomp ($FILE_LDAP = <STDIN>); print "Please input sig file: "; chomp ($FILE_SIG = <STDIN>); $FIELD_LIST_CMP1 = `grep "Event ID" $FILE_LDAP`; $FIELD_LIST_CMP2 = `grep "Event ID" $FILE_SIG`; if ($FIELD_LIST_CMP1 ne $FIELD_LIST_CMP2) { print "List of fields do not match\!\n"; exit; } $FIELD_LIST = `grep "Event ID" $FILE_LDAP`; chomp $FIELD_LIST; push @FIELD_LIST, split ("<~>",$FIELD_LIST); @COMM = split /\n/,`comm -3 $FILE_LDAP $FILE_SIG`; &Check_EV; &Check_Text; sub Check_EV { # Check for <~> in the line. @FIELD_DIFF = grep /<~>/, @COMM; # This gets list of Event ID's for (@FIELD_DIFF) { # unix comm command seperates differences in columns if (!/^\s/) { @var = (split /<~>/, $_); push @EV_LIST, $var[0]; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Some tricky array/hash work
by jlongino (Parson) on Oct 10, 2001 at 07:27 UTC |