Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm having some issues with some web code I'm writing. It's supposed to print the values that the user input, then do some processing (the printout is just to verify to the user that it got the data, so they don't think the sometimes-long-wait means that it's locked up). Here's some of the relevant code:
$| = 1; select(STDERR); $| = 1; select(STDOUT); $| = 1; print <<END_HTML; Content-type: text/html \n\n <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> END_HTML #reads the input values here print END_HTML; <title>PAGE TITLE</title> <!--OTHER HTML HEADER STUFF--> </head> <body> <!--VISIBLE PAGE HEADINGS AND STUFF--> END_HTML print "value: $value<br>"; # the above line is repeated for each input value open(temp_handle, "> log_file"); print(temp_handle "log stuff"); #repeated with information close temp_handle; system("external_program"); # the above program can take several seconds to several # minutes to run print <<END_HTML; </BODY> </HTML> END_HTML
What happens is that it displays on the client everything up to and including the "visible page headers" stuff, but none of the values. However, when I set $| = 0 for the STDOUT one, it prints everything and then does the processing. Am I misunderstanding how $| works?

In reply to I think I'm misunderstanding $| by sigmazero13

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-24 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found