On Tue, Jan 20, 2015 at 9:47 AM, Mike Martin wrote:
> Thanks for the idea about qr, I did try this before, but I've now relooked
> at at it and got about 75% improvement.
>
> As regards the uninitialized point the errors were coming from regexes
> (different ones) when the regex wasnt matching, so
On Tue, 20 Jan 2015 17:47:58 +
Mike Martin wrote:
> Take a load of Job Vacancy posts (xml files - loads of)
> Parse the Information, getting rid of as much garbage as possible
> Push a distinct list into a lookup hash
If you're running Linux (or any POSIX), see `man sort` and search
for /-u/
Thanks for the idea about qr, I did try this before, but I've now relooked
at at it and got about 75% improvement.
As regards the uninitialized point the errors were coming from regexes
(different ones) when the regex wasnt matching, so testing the result of
each regex match was not really an opti
What the OP should do is put the regexes in a Perl module and unroll
the loop. That way, he can group them so that groups of tests are
skipped:
# strings containing "foo"
if( /foo/ ){
return "food" if /food/;
return "fool" if /fool/;
return "foot" if /foot/;
return "foo";
}
--
On Tue, 20 Jan 2015 10:23:42 -0500
Brandon McCaig wrote:
> On Tue, Jan 20, 2015 at 10:21 AM, Brandon McCaig
> wrote:
> > perldoc -f qr//
>
> I was sure that worked in my up-to-date perlbrew environments, but it
> isn't working in Cygwin running perl 5.14.2 so in the event that it
> doesn't work
On Tue, Jan 20, 2015 at 10:21 AM, Brandon McCaig wrote:
> perldoc -f qr//
I was sure that worked in my up-to-date perlbrew environments, but it
isn't working in Cygwin running perl 5.14.2 so in the event that it
doesn't work for you look at `perldoc -f qr' and `perldoc perlop'
(then search for "q
On Tue, Jan 20, 2015 at 9:51 AM, Andrew Solomon wrote:
> Aside from this lengthy rant^H^H^H^H discussion:) about where you put
> your regex, have you made any progress on the performance problem you
> put forward at the outset?
I'm not quite sure that I understand what the OP is doing still, but
Hey Mike
Aside from this lengthy rant^H^H^H^H discussion:) about where you put
your regex, have you made any progress on the performance problem you
put forward at the outset?
cheers
Andrew
On Tue, Jan 20, 2015 at 6:41 AM, Danny Spell wrote:
> For me, regex can be simple or complex.
> It depen
For me, regex can be simple or complex.
It depends on the task at hand.
The more complex the task, the more complex the regex.
My boss who can code, but doesn't want to, *HATES* regex.
Personally, I think it is pretty powerful and I'm grateful for its
flexibility.
I use it daily in my job where s
On Mon, 19 Jan 2015 11:43:41 -0500
John Mason wrote:
> On Mon, Jan 19, 2015 at 11:36 AM, Shawn H Corey
> wrote:
>
> > On Mon, 19 Jan 2015 11:18:01 -0500
> > bill pemberton wrote:
> >
> > > I fail to see why a regex can only be changed by a programmer.
> > > please expand upon this.
> >
> > You
On Mon, Jan 19, 2015 at 11:36 AM, Shawn H Corey
wrote:
> On Mon, 19 Jan 2015 11:18:01 -0500
> bill pemberton wrote:
>
> > I fail to see why a regex can only be changed by a programmer. please
> > expand upon this.
>
> You shouldn't blindly trust input from a user, there should be
checking/limit
On Mon, 19 Jan 2015 11:18:01 -0500
bill pemberton wrote:
> I fail to see why a regex can only be changed by a programmer. please
> expand upon this.
Regex is a programming language in its own right. Why should an
average user have any knowledge of it?
--
Don't stop where the ink does.
On Mon, 19 Jan 2015 15:57:35 +
Andrew Solomon wrote:
> On Mon, Jan 19, 2015 at 2:50 PM, Mike Martin
> wrote:
> > The lookup hash is like this
> > %clean=(
> > HeatingEngineer => (?:Heating.*?Engineer)\b.*?
> > HGV
> > Driver=>(?=\A(?:(?!tech|mech).)*$)(?:HGV|LGV|Class.?1|Class.?2).?(?
First question which comes to mind is - do you really need to call
sort in those two foreach collections? Sort can often take time, and
the fact that you've got one sort nested inside a foreach loop is bad
karma:)
Andrew
On Mon, Jan 19, 2015 at 2:50 PM, Mike Martin wrote:
> The lookup hash is li
The lookup hash is like this
%clean=(
HeatingEngineer => (?:Heating.*?Engineer)\b.*?
HGV
Driver=>(?=\A(?:(?!tech|mech).)*$)(?:HGV|LGV|Class.?1|Class.?2).?(?:1|2|3|)(?:.+Driver|).*?
HGV Mechanic=> (?:(?:HGV|LGV|Lorry).+(?:Mech?anics?|technicians?))\b.*?
Highway Engineer=> (?:(?:Highway.?) (?:En
Mike:
On Mon, Jan 19, 2015 at 01:25:56PM +, Mike Martin wrote:
> Hi
Hello,
> I am looking for the most performant way to achieve this
>
> I have a big list of text (47+ lines in a hash) I then run
> a hash ref consisting of replacement text - pattern to search -
> optional 3rd param for
Hi
I am looking for the most performant way to achieve this
I have a big list of text (47+ lines in a hash)
I then run a hash ref consisting of
replacement text - pattern to search - optional 3rd param for grouping
matches
So I loop through the text and then loop the regex hash against each r
17 matches
Mail list logo