From: <RGi...@a1...> - 2002-03-19 09:58:23
|
> > 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 packagevariables, 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? Don't forget that an Expect object is basically a filehandle, and the semantics of cloning a filehandle are vague, to say the least. Should the filehandle be connected to the same file/process? Should we reuse the pty? Copy the tty settings? Or just the Expect-specific parameters? I don't see a clear, easy DWIM-solution for this, so I wouldn't poke deeper into this snake-pit... But what I could add is a check that prohibits spawning another process with an already-used object to avoid such misunderstandings. And of course amend the docs... Roland -- RGi...@cp... |