Re: Perl Analyzing Maillog

2005-03-22 Thread Offer Kaye
On Tue, 22 Mar 2005 11:47:31 +, Nick Chettle wrote: > > My Regex: > > ([A-Z1-9]{8}) > [...snip...] > I was expecting it to match "291E2130". > Well, you have a zero ("0") as the 8th char, but your regexp only matches the numbers 1-9, so it can hardly match, now can it? ;-) -- Offer Kay

Re: Perl Analyzing Maillog

2005-03-22 Thread Nick Chettle
Wagner, David --- Senior Programmer Analyst --- WGO wrote: I took a quick look at some of the earlier emails and Charles Clarkson's email is what you are after. Using the push on your hash to create the array. You're quite right, it does. I was testing it and was getting the same result as with

RE: Perl Analyzing Maillog

2005-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nick Chettle wrote: > Wagner, David --- Senior Programmer Analyst --- WGO wrote: > >> Then concatenate in something like: >> $msgids{"$1"} .= $msgarray[$_]; >> Wags ;) > > Thanks for the speedy response. > > Sorry, but I don't understand how to use that. Surely that would be >

Re: Perl Analyzing Maillog

2005-03-21 Thread Nick Chettle
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Then concatenate in something like: $msgids{"$1"} .= $msgarray[$_]; Wags ;) Thanks for the speedy response. Sorry, but I don't understand how to use that. Surely that would be trying to index an array but a great l

RE: Perl Analyzing Maillog

2005-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nick Chettle wrote: > Charles K. Clarkson wrote: >>> I've been thinking about it an wondering if it needs to be this >>> complex. Can't I just create a hash (With the message ID as the key) >>> and the line as data? I tried: >> >> Only if the message ids are unique. I have no idea what a mail

Re: Perl Analyzing Maillog

2005-03-21 Thread Nick Chettle
Charles K. Clarkson wrote: : I've been thinking about it an wondering if it needs to be this : complex. Can't I just create a hash (With the message ID as the key) : and the line as data? I tried: Only if the message ids are unique. I have no idea what a mail log looks like, so I don't know if

RE: Perl Analyzing Maillog

2005-03-19 Thread Charles K. Clarkson
Nick Chettle wrote: : Charles wrote: : Thanks for the help, but neither of the examples you gave seem to : work. First thing. Stop replying to a post by placing all you comments at the top of the post. It is annoying and requires I do extra work (mainly scrolling

[Fwd: Re: Perl Analyzing Maillog]

2005-03-19 Thread Nick Chettle
Thanks for the help, but neither of the examples you gave seem to work. The first errors with: % ./1 Global symbol "$msgids" requires explicit package name at ./1 line 15. Execution of ./1 aborted due to compilation errors. The second errors with: % ./2 Please enter an e-mail address: [EMAIL PROTEC

RE: Perl Analyzing Maillog

2005-03-16 Thread Charles K. Clarkson
Nick Chettle wrote: : I am not 100% sure what this line does. : : push @{ $msgids->{$1} }, $_; : : Is the @{} surrounding the hash used to make push work with a hash? No. We cannot push items onto a hash. We need an array for that. "$msgids->{$1}" is an array refe

Re: Perl Analyzing Maillog

2005-03-16 Thread mgoland
- Original Message - From: Nick Chettle <[EMAIL PROTECTED]> Date: Wednesday, March 16, 2005 10:01 am Subject: Re: Perl Analyzing Maillog > Hi, Thanks, that seems a far better way to do it. A few things though: > > I am not 100% sure what this line does. $msgids is a refe

Re: Perl Analyzing Maillog

2005-03-16 Thread Zeus Odin
"Nick Chettle" <[EMAIL PROTECTED]> wrote in message ... > Hi All, Hi, Nick. > #!/usr/bin/perl This is a very good start. Never forget: use warnings; use strict; These are two of the most important lines in the script :-) If you had used these simple two lines, you would have found a ma

Re: Perl Analyzing Maillog

2005-03-16 Thread Nick Chettle
te: Wednesday, March 16, 2005 7:02 am Subject: Perl Analyzing Maillog Hi All, Hello, I am trying to write a simple script that will analyze a Postfix maillog. The basic idea is that you give it an e-mail address and it will print all the relevant lines. In order to achieve this, you first

Re: Perl Analyzing Maillog

2005-03-16 Thread mgoland
- Original Message - From: Nick Chettle <[EMAIL PROTECTED]> Date: Wednesday, March 16, 2005 7:02 am Subject: Perl Analyzing Maillog > Hi All, Hello, > > I am trying to write a simple script that will analyze a Postfix > maillog. The basic idea is that you give it

Perl Analyzing Maillog

2005-03-16 Thread Nick Chettle
Hi All, I am trying to write a simple script that will analyze a Postfix maillog. The basic idea is that you give it an e-mail address and it will print all the relevant lines. In order to achieve this, you first need a message ID, you can then search for the id and bring all the relevant infor