while( total_ignorance ) help

Discussion in 'Perl' started by john prokopek, Aug 1, 2003.

  1. I just installed ActiveState Perl 5.8 on a Win2k system. For a sanity
    check I a one line script to take input from STDIN and print. Hey it
    doesn't work. If I just perform a print with some text that works. So
    can someone clue me in.


    So, why doesn't this print out anything:


    while(<STDIN>) { print;}

    or

    while ($line = <STDIN>) {print $line;}


    thanks


    John
     
    john prokopek, Aug 1, 2003
    #1
    1. Advertising

  2. Okay, so it is really a piping issue

    so, my input problem is a result of using perl in a windows environment.
    I wanted to use my script in the following manner:


    dir /b | script.pl

    Well in windoze this doesn't seem to work.
    Is there any way to get this work as is?

    thank you for your help


    john

    john prokopek wrote:
    > I just installed ActiveState Perl 5.8 on a Win2k system. For a sanity
    > check I a one line script to take input from STDIN and print. Hey it
    > doesn't work. If I just perform a print with some text that works. So
    > can someone clue me in.
    >
    >
    > So, why doesn't this print out anything:
    >
    >
    > while(<STDIN>) { print;}
    >
    > or
    >
    > while ($line = <STDIN>) {print $line;}
    >
    >
    > thanks
    >
    >
    > John
    >
    >
     
    john prokopek, Aug 1, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ^CrazyCoder^
    Replies:
    3
    Views:
    7,333
    Terrence Benade
    Sep 15, 2003
  2. David
    Replies:
    1
    Views:
    525
    David
    Jul 19, 2004
  3. Steven

    while loop in a while loop

    Steven, Mar 24, 2005, in forum: Java
    Replies:
    5
    Views:
    2,293
    Tim Slattery
    Mar 30, 2005
  4. Sam
    Replies:
    0
    Views:
    431
  5. Timothy Fitz

    while 1 vs while True

    Timothy Fitz, Dec 13, 2004, in forum: Python
    Replies:
    16
    Views:
    649
    Terry Reedy
    Dec 15, 2004
Loading...

Share This Page