develooper Front page | perl.perl5.porters | Postings from April 2000

Re: What's left to do? [LONG]

From:
Roland Giersig
Date:
April 11, 2000 09:04
Subject:
Re: What's left to do? [LONG]
Message ID:
38F34CD5.1D9488AD@alcatel.at
Tom Hughes wrote:
> 
> In message <14553.38872.981137.976952@dell.rls.cx>
>           rspier@pobox.com (Robert Spier) wrote:
> 
> > The Expect.pm interface is similar to TCL's Expect interface (which I
> > have never used.), and while it takes a while to get used to it, and
> > the documentation is spread out through a few different files and
> > examples, it's not ``horrid''
> 
> I found that the interface was unnatural for simple things like
> waiting for a listing strings or for an re.
> 
> Specifically the business of passing '-re' before the strings to
> make them match as re's is wierd. I'd have though that assuming an
> re would make more sense.
> 
> Equally indicating the match as an index into the list makes for
> lots of magic constants in code. I'd rather get back the string
> that match, rather than then having to call another routine to get
> that.

That's why I took the liberty to expand Expect.pm's interface to
something more useful half a year ago.  Most important, I added
multi-match functionality to allow to listen on several datastreams
at once.  I also added callback-functionality where one gives
a regexp (without `-re'!) and a code ref (with parms) that gets
called on match, allowing a much more perlish usage.

I have sent a patch to the author (Austin Schutz <tex@habit.com>)
and he wanted to incorporate it and publish it after some
other cleanup, but obviously never got around.  I sent him
e-mail inquiring about the status a few days ago but haven't 
received an answer yet.

Interested?  Maybe I should publish it myself...

Roland
--
Roland.Giersig@alcatel.at         Phone: +43-1-27722-3755
ALCATEL Austria, Dept. RTPM       FAX:   +43-1-27722-3955
Scheydgasse 41, A-1210 WIEN, Austria (no Kangaroos here!)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About