From: <db...@CT...> - 2003-05-15 16:49:20
|
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' .. :-). Only think I can think of, is that somehow your code is getting confused, and printing the object itself instead of the function "before" on the expect object itself (if that makes sense), which if done, might look on your screen something like "Expect=GLOB(0x2ffbdc)". I might add that $obj->exp_before() and $obj->exp_after are not to be confused with the tcl/Expect version "expect_before()" and "expect_after()" which are completely different. I'm not suggesting this is a bad thing, just pointing out that use of these commands might create a little confusion with those already familiar with the Tcl version and are starting to use this module (caveat programmor). For what it's worth, hope this helps, "BLACKSTONE, J. DAVID" <jda...@ci...> To: "'Roopa'" <ro...@de...> Sent by: cc: exp...@li... exp...@li...urc Subject: RE: [Expectperl-discuss] Help !! eforge.net 05/15/2003 10:02 AM I'm under the impression Expect->before should always contain the contents of the buffer from before the last match. I'm not sure why it would give you a glob. jdb -----Original Message----- From: Roopa [mailto:ro...@de...] Sent: Thursday, May 15, 2003 12:31 AM To: BLACKSTONE, J. DAVID Subject: Re: [Expectperl-discuss] Help !! Hello, Thanks for the reply. I have a query regarding expect : What actually does $exp->before contain ? when i do $exp->send( "Hello\n" ) ; $exp->expect(5, -re, "Hello\r\n" ) and the expect matches, then print expect->before,it is printing some GLOB = value. But if it doesnt match it give me the buffer containing what was printed on screen. Shouldnt expect before always return the buffer before last expect ? Roopa ----- Original Message ----- From: BLACKSTONE, J. DAVID To: 'Roopa' ; exp...@li... Sent: Tuesday, May 13, 2003 7:05 PM Subject: RE: [Expectperl-discuss] Help !! Hi, Roopa. This is more of a general Perl issue than a Perl expect issue. Perl comes with a wealth of online documentation, which you can access with the perldoc program, or also at http://www.perldoc.com/ . I believe you'll find the perlretut manpage available at http://www.perldoc.com/perl5.8.0/pod/perlretut.html covers what you need. If you've never done regular expressions before, you'll want to start at the beginning (and maybe even read perlrequick first at http://www.perldoc.com/perl5.8.0/pod/perlrequick.html); otherwise, just search for "multi-line" on that page. To build your Perl skills, I emphatically recommend that you read through the documentation in the order given at http://www.perldoc.com/perl5.8.0/pod/perl.html , and purchase the "Llama book" _Learning Perl_ by Randall Schwartz et. al., and the "Camel book" _Programming Perl_ by Larry Wall et. al. jdb -----Original Message----- From: Roopa [mailto:ro...@de...] Sent: Tuesday, May 13, 2003 5:21 AM To: exp...@li... Subject: [Expectperl-discuss] Help !! Hi all, I am new to perl programming and expect and need some help. I want to compare the output of my API execution with the expected result. How can i do this ? My exp->before gives me the output of my test execution which i want to compare with another buffer $result. Each of these have several lines. E.g Hello World This is my first program. How to do this multi line comparison ? ********************************DISCLAIMER********************************** This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege of Deccanet Designs Ltd. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from retaining, using, copying, altering or disclosing the contents of this message. **************************************************************************** |