Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

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

hrmm... your script fails horribly for me. It freezes after I type the first character. The 'Type fast:' prompt is also right-flushed on my terminal. Uncommenting your cygwin line fixes the right-flushed text, but that is a bad way to do it. $/ is best kept at "\n". Try using \015\012 instead of \r\n as well. "\r\n" and "\015\012" are not guaranteed to be the same value. So to beat the snot out of POE for once (and most likely only time) in my life heh:

#!/usr/bin/perl -w $|++; use strict; my ($input, $failed); STARTIT: eval { local $SIG{ALRM} = sub { die "timed out\n" }; print 'You have 10 seconds. Type fast: '; alarm 10; chomp( $input = <STDIN> ); alarm 0; }; if ($@) { if ($@ eq "timed out\n") { if (++$failed == 3) { print "\nTimed out 3 times. You're toast!\n\n" and exit; } else { print "\nTimed out. Try again!\n\n"; } } else { die "Unhandled error: $@"; } } else { print "You said '$input'. 10 more seconds now!\n\n"; } goto STARTIT;

If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

In reply to Re: An introduction to POE by Coruscate
in thread An introduction to POE by RMGir

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 avoiding work at the Monastery: (7)
    As of 2020-09-23 12:38 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (131 votes). Check out past polls.