From: Austin S. <te...@of...> - 2003-05-15 18:23:12
|
On Thu, May 15, 2003 at 12:48:49PM -0400, db...@CT... wrote: > > To affirm what Dave said, all of the examples I ran would indicate that > "$obj->exp_before()" does in fact work as advertised; i.e., returns > 'before' part of the last expect call, so I'm not sure either (I tried to > trick it! but it kept working as 'expected' .. :-). I think you have nailed the answer, though perhaps unintentionally. "$obj->exp_before()" is not the same thing as $obj->exp_before(). When you use double quotes in perl the interpreter will interpolate data from data structures, but it _will not_ execute subs. Thus "$obj->exp_before()" will be printed as Expect=GLOB(0x234243)->exp_before() or similar. If you want to use it in a string do something like: print "Before the match: '" . $obj->exp_before() . "'\n"; Though the original question didn't specify printing inside double quotes, I would bet $5 that was the problem. Austin |