Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

You should use $exp->log_file to log the debug output to a file instead of to STDOUT while running the script in apache. Look for differences in the log to what you see in the log when you execute it on the command line/terminal

Getting eof probably means that the mod_perl version of the script doesn't get any output from the units script. Do you see the output maybe in your browser page (highly unlikely)?

Very important: Check apache log files for any hints of what is happening

Expect FAQ says this:

Is it possible to use threads with Expect?

Basically yes, with one restriction: you must spawn() your programs in the main thread and then pass the Expect objects to the handling threads. The reason is that spawn() uses fork(), and perlthrtut:

"Thinking of mixing fork() and threads? Please lie down and wait until the feeling passes."

If your apache uses threads instead of forks, this might be a problem. I'm not sure about apache, on linux it should probably use fork (if you do "ps -ef" on the command line, you should see multiple lines with "httpd" or "apache"). On windows it probably uses threads

As a test you could change the execution of "units" to a simple "echo you have" and look at the log output. If that changes anything your apache seems to have problems executing units. But then you should have found out about this in the log files, so this test is just to make double sure it is not the units program that is the problem

You could ask the mailing list mentioned in the documentation (expectperl-discuss) if they know whether expect is generally working or not working in mod_perl

In reply to Re^3: Expect doesn't work as Expected by jethro
in thread Expect doesn't work as Expected by keenlearner

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (2)
    As of 2019-02-17 09:45 GMT
    Find Nodes?
      Voting Booth?
      I use postfix dereferencing ...

      Results (96 votes). Check out past polls.