From: <db...@CT...> - 2003-05-15 22:32:27
|
Good catch! I was using the quotes in the first paragraph for emphasis, and should have been more careful with what this meant syntactically. I do apologise for any confusion this may have caused for readers, albeit it might have serendipitously identified what was being done originally(?) I was considering an attempt at printing $obj to be culprit instead of intended $obj->before, but did not consider printing "$obj->before" as the culprit. thanks for identifying this, David B. Austin Schutz <te...@of...> Sent by: To: db...@ct... exp...@li...urc cc: "'Roopa'" <ro...@de...>, "BLACKSTONE, J. eforge.net DAVID" <jda...@ci...>, exp...@li..., exp...@li... 05/15/2003 02:22 PM Subject: Re: [Expectperl-discuss] Help !! 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 ------------------------------------------------------- Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |