[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Xmail



On Sat, 2 Aug 1997, Strider wrote:
> I love unix. Love it. Mklinux is the best.
>
> I hate installing unix programs, and I don't like the way they run when I
> have them. So: I figured, why not write a text based PERL E-Mail program of
> my own? Here it is:
[snap]
> after using ANY routine that requires input, I need to put a break after
> everything I type (command-.) so that the program continues. I've tried
> multiple versions of this, with while (<>) {  and eval() and if () and
> nothing works. Any ideas?
>
> -Seraph
>
>

I had the same problem in some of my scripts. Amazingly, the same piece of  
code could perfectly works in some cases, or could have this strange behavior.  


Try to use <STDIN> instead of <>, it seems to avoid some cases, but not always. 

Note that a trick which works in most cases is to use getc()

    print "Press Enter to continue.\n";
    do { $c = getc(STDIN) } until defined $c;

But once again, I had cases where it doesn't work.. :-(

--------------------------
APERGHIS-TRAMONI Sebastien
Word Wide Web : http://www.resus.org/~madingue
E-Mail : madingue@cis.uni-muenchen.de
        (madingue@tango.resus.univ-mrs.fr)

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch