|
From: Austin S. <te...@of...> - 2002-03-19 06:01:13
|
> > If there are a few settings in particular you are interested in
> > setting it would probably be easiest to copy them before you destroy
> > to old object, e.g.:
> > sub copy_settings {
> > my($old,$new) = @_;
> > $new->exp_internal($old->exp_internal());
> > ...
> > }
> sounds reasonable. May be it's time to add a 'clone' function to Expect?
> All 'shareable' settings are to be copied inside the func, and unique
> ones get re-created... Unfortunately I know too little about an Expect's
> object insides for the moment and probably can't say exactly whether
> 'clone' should allocate a new pty for each new instance etc...
>
I think you would have to. So, the purpose of the clone would be
to do something like spawn a process using the same parameters? I guess I'm
not seeing much benefit over setting the default parameters using package
variables, e.g. $Expect::Exp_Internal. Maybe I don't understand the concept
of 'clone' well enough.
Also, how would it apply to filehandles expectified using
exp_init?
> > As Roland says, we might want to make this a new sub in the Expect
> > module. I'm not sure which items we'd want to have in there by default,
> > e.g. terminal params(?).
> Hmm, looks like I just repeated your words before reading entire message
> :-)...
>
Maybe, but you use new and interesting vocabulary. :-)
> Thank you and Roland a lot (but I can't see his mail in my box yet :-(
> ).
Mostly Roland. He's been doing all the work lately :)
Austin
|