[Jerusalem.pm] lazy lists
Eitan Schuler
Eitan.schuler at exlibris.co.il
Wed Jun 23 01:51:37 PDT 2004
well, benchmark it!
something like:
use Benchmark;
timethese(20000,
{
mem => q{.................
Examples for benchmark are in my presentation on "Making your regular
expressions efficient" at the end...
goto our website: http://jerusalem.perl.org.il - > previous meetings - >
19April -> and click on the presentation.
> -----Original Message-----
> From: Yehuda Berlinger [mailto:jon at actcom.co.il]
> Sent: Wednesday, June 23, 2004 9:43 AM
> To: Jerusalem Perl Mongers
> Subject: RE: [Jerusalem.pm] Yesterday's meeting
>
>
> Yes, I thought of something like that. I wonder how efficient it is.
>
> Thanks,
> Yehuda
>
> 23 Jun 2004
>
> > Motke has suggested a solution like this:
> >
> > $delta = 1000;
> > $from = 0;
> > $to = $delta;
> > while (@big_matches < $n) {
> > push @big_matches, @matches = grep { $_ =~ /$pattern/ }
> > @ReallyBigArray[$from..$to];
> > $from = $to+1;
> > $to += $delta;
> > }
> >
> > I don't know a simple way to do that.
> > Eitan
> >
> >
> > > -----Original Message-----
> > > From: Yehuda Berlinger [mailto:jon at actcom.co.il]
> > > Sent: Wednesday, June 23, 2004 9:22 AM
> > > To: Jerusalem Perl Mongers
> > > Subject: Re: [Jerusalem.pm] Yesterday's meeting
> > >
> > >
> > > I'm really sorry that I can't seem to make any of these meetings.
> > > Yesterday evening was the final party in my kids school.
> > >
> > > I really wanted to know about functional programming, too, since I
> > > had just such a problem come up regarding lazy lists.
> > >
> > > I wanted to know if there was a way to break a grep after
> a certain
> > > number of matches:
> > >
> > > @matches = grep { $_ =~ /$pattern/ } @ReallyBigArray;
> > >
> > > Of course I can use a loop, a counter and the last command. I
> > > understand that lazy lists might be coming in Perl 6.
> There are also
> > > some cpan modules for this, but I don't think they do what I need.
> > >
> > > Yehuda
> > >
> > > 23 Jun 2004
> > >
> > > > Dear Perl Mongers,
> > > > We had a very good meeting yesterday, I gave a short talk on two
> > > > topics: "Splitting filename into its components" and "Flushing
> > > > output". Then we have heard an interesting session from
> Zach about
> > > > "Lisp and Perl - functional programming". We were 8 in this
> > > meeting. I
> > > > will send out announcement on the next meeting as soon as
> > > we will know
> > > > the exact date.
> > > >
> > > > We have introduced our web-site: http://jerusalem.perl.org.il In
> > > > this site almost all presentations / examples are/will be
> > > > available. It includes information on meetings as well.
> > > Please send me
> > > > comments and new ideas if you have. I think of a "link
> > > page" where we
> > > > can list all perl links. Please send me perl-site links if you
> > > > know some. I would like to emphasize that the website
> is in it's
> > > very first
> > > > stages.
> > > >
> > > > Regards
> > > > Eitan Schuler
> > > >
> > > > _______________________________________________
> > > > Jerusalem mailing list
> > > > Jerusalem at perl.org.il
> > > > http://perl.org.il/mailman/listinfo/jerusalem
> > >
> > >
> > > _______________________________________________
> > > Jerusalem mailing list
> > > Jerusalem at perl.org.il
> > > http://perl.org.il/mailman/listinfo/jerusalem
> > >
> > _______________________________________________
> > Jerusalem mailing list
> > Jerusalem at perl.org.il
> > http://perl.org.il/mailman/listinfo/jerusalem
>
>
> _______________________________________________
> Jerusalem mailing list
> Jerusalem at perl.org.il
> http://perl.org.il/mailman/listinfo/jerusalem
>
More information about the Jerusalem
mailing list