Omega -1911 wrote:

Thanks Rob,

Is this homework? Not hardly! I was sitting here the other day and the
thought came to mind as our state lottery has not had a winner in
over a year. (The public started thinking that there is a conspiracy
because it was exactly a year ago that our state went to computer
generated lottery numbers AND there has not been a winner since! -Look
up the Hoosier Lottery Drawing).

I will give yours as well as the other examples a try and will
benchmark the fastest code.

Never concern yourself with the speed of a program unless it's running
too slowly or you're paying for the run time somehow. By far the most
important thing (as long as it works) is how easy it is to understand.

Homework though? What gave you that idea? It is my only wanting to
expand my mind when dealing with parsing information from a page via
regular expressions without the use of a module.

Just the style of your post really. You phrased it very like a
homework question, in particular the details of the implementation
that aren't at all relevant in the statement of a problem:

Omega -1911 wrote:
Can anyone assist with a regex to pull lottery numbers from a page?

With real-world problems it's irrelevant whether the solution involves
a regular expression. And:

Omega -1911 wrote:
What I will need to be able to do is place the most common 5 numbers
(before the word "powerball") into an array then place the powerball
numbers into another array.

Although it's likely that arrays will be involved there's no reason,
unless you're setting homework, to say that they must be used. What you
want is just the five most frequent ball numbers. Finally:

Omega -1911 wrote:
All data from the web page is pushed into an array. ( Header and
footer info is removed before being pushed into the array.)

This is the sort of stuff examiners put into questions to avoid people
writing reams of unnecessary code to process data irrelevant to the
question. Furthermore it's nonsense if it's a real web page as if it's
all in HTML, the headers are the least of the problems, and there are
no footers!

And as these things occurred to me after I'd coded a complete solution
I posted it anyway and asked the question, hoping I shouldn't have done
a little less solving and a little more guidance.

Cheers,

Rob



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to