Dear shmem,

Thanks a lot for the response.
You were instrumental in understanding me the working

You saved my day!!! :)

Could you please put some light on how did you managed to get only a single instance of the answers in your run that we are sending to the installation script?

I am getting either 3 (when ran your script as is) or none (when I have: $expObj->raw_pty(1)).

Sample output:

bash-3.00# ./installPerl.pl So we are poing to install The Best All-Purpose Compiler ever. It groks perl, java, c#, haskell, forth and lisp and many more all at the same time. Big deal.

# ========= 3 instances in OUTPUT BELOW =========

Path for package: /foo/bar/quux /foo/bar/quux /foo/bar/quux you said: '/foo/bar/quux', good. We'll come back to that. We want some sensitive information from you to harrass you on every IRC channel in which you talk bad of our product. Yes, we monitor them all. What is your nick? shmem shmem shmem you said: 'shmem', good. We'll come back to that. The next abomination is optional. PLEASE think again if you are inclined to install support for that cruft. do you want Visual Basic support? NO! NO! NO! you said: 'NO!', good. We'll come back to that. Thank you for using The Great Foo. All done. bash-3.00#

Code showing no instances of the answers:
modified this single line in install.pl:

print "you said: '$foo', good. We'll come back to that.\n";
to include a newline character as:
print "\nyou said: '$foo', good. We'll come back to that.\n";

Sample run:
----------------------------------------

bash-3.00# ./installPL.pl So we are poing to install The Best All-Purpose Compiler ever. It groks perl, java, c#, haskell, forth and lisp and many more all at the same time. Big deal.

# ========= NO instances in OUTPUT BELOW =========

Path for package: you said: '/foo/bar/quux', good. We'll come back to that. We want some sensitive information from you to harrass you on every IRC channel in which you talk bad of our product. Yes, we monitor them all. What is your nick? you said: 'shmem', good. We'll come back to that. The next abomination is optional. PLEASE think again if you are inclined to install support for that cruft. do you want Visual Basic support? you said: 'NO!', good. We'll come back to that. Thank you for using The Great Foo. All done. bash-3.00#
Regards,
~DeepBlue

In reply to Re^4: Need a solution to Expect.pm 's single line regex matching limitation by deepblue
in thread Need a solution to Expect.pm 's single line regex matching limitation by deepblue

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.