Re: Handling blank lines in while() construct

2004-03-05 Thread R. Joseph Newton
Michael Weber wrote: ... > Pretty much accurate. The text stream looks like this: > > [Snip from /var/log/maillog] > Feb 29 16:52:01 web-2 postfix/smtpd[32047]: 6AD1EBBEF: reject: RCPT > from unknown [12.127.237.226]: 554 : Helo command > rejected: Don't spoof my hostname; from=<[EMAIL PROTECTED]

RE: Handling blank lines in while() construct

2004-03-05 Thread Michael Weber
PROTECTED] >> Sent: Friday, 5 March 2004 4:16 AM >> To: Michael Weber >> Cc: [EMAIL PROTECTED] >> Subject: Re: Handling blank lines in while() construct >> >> As far as this: >> >> "$yellow")} >> elsif ( $conf_

Re: Handling blank lines in while() construct

2004-03-05 Thread WC -Sx- Jones
David le Blanc wrote: As far as this: "$yellow")} elsif ( $conf_line[1] =~ "blue" ) {push(@color_array, Why not just: sub push_Colors() { my $color = shift; push(@color_array,$color) } Called like: push_Colors($conf_line[1]); I thought he was pushing '$yellow' when he

RE: Handling blank lines in while() construct

2004-03-05 Thread David le Blanc
> -Original Message- > From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] > Sent: Friday, 5 March 2004 4:16 AM > To: Michael Weber > Cc: [EMAIL PROTECTED] > Subject: Re: Handling blank lines in while() construct > > As far as this: > > "$yellow")} &

RE: Handling blank lines in while() construct

2004-03-05 Thread David le Blanc
> From: Michael Weber [mailto:[EMAIL PROTECTED] > Sent: Friday, 5 March 2004 2:16 AM > To: [EMAIL PROTECTED] > Subject: Handling blank lines in while() construct > > I wrote a perl script that adds colors to text streams on the > fly. It's > really handy for watching log files as they run past.

Re: Handling blank lines in while() construct

2004-03-04 Thread John W. Krahn
Michael Weber wrote: > > I wrote a perl script that adds colors to text streams on the fly. It's > really handy for watching log files as they run past. I watch my mail > log files after making config changes and can mark "reject" in red, > "spam" in blue, discard is red and my console beeps, etc

Re: Handling blank lines in while() construct

2004-03-04 Thread WC -Sx- Jones
Michael Weber wrote: open (CONF, $ARGV[0]) || die "Can't open config file $ARGV[0], $!\n"; while () { while() { chomp; s/^\s+//; s/\s+$//; next unless length; ... @conf_line=split(","); As far as this: "$yellow")} elsif ( $conf_line[1] =~ "blue" ) {push(@color_

Re: Handling blank lines in while() construct

2004-03-04 Thread James Edward Gray II
On Mar 4, 2004, at 9:16 AM, Michael Weber wrote: [snip background] Here's the loop where I read in the config file: open (CONF, $ARGV[0]) || die "Can't open config file $ARGV[0], $!\n"; while () { Try adding: next if m/^\s*$/; @conf_line=split(","); push(@trigger_array, "$co