#7 Console input sends whole line to STDIN

open
nobody
None
5
2001-08-31
2001-08-31
Anonymous
No

Executing this script from PerlIDE demonstrates problem:

$| = 1;
print "Enter something now:";
my $line = <STDIN>;
print "I got: $line\n";

The whole console line is sent to STDIN -- not just the stuff the user types. It is also possible to delete the "Enter something now:" request line although this doesnt matter for testing purposes.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    A workaround for this problem could be to add the '\n' to
    the first print command. It should look like

    print "Enter something now:\n";

    This works fine I think

     
  • Nobody/Anonymous

    Logged In: NO

    unfortunately, it dosen't work.

     
  • Nobody/Anonymous

    Logged In: NO

    Yes, took a while to understood what was wrong in my code
    until I figured out it was bug in PerlIde. Could someone fix
    that?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks