in reply to STDIN under MAC OS 10.4.11
Here are some examples of shell commands that execute the three lines of perl code you showed us, and these all work for me, using command lines in a Terminal shell window (or in an xterm shell) -- I'm showing the shell prompt ("bash$ ") so that you can see which lines are command-line inputs that I typed; the lines that don't start with "bash$ " are the command outputs.
So, what are you doing that is different from those examples?bash$ perl -e 'print "What is your name? "; $name = <STDIN>; print "Yo +ur name is $name\n"' What is your name? Me Your name is Me bash$ cat test.perl #!/usr/bin/perl print "What is your name? "; $name = <STDIN>; print "Your name is $name\n"; bash$ chmod +x test.perl bash$ test.perl What is your name? You Your name is you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: STDIN under MAC OS 10.4.11
by AliceQuint (Initiate) on May 25, 2008 at 14:39 UTC | |
by graff (Chancellor) on May 26, 2008 at 17:49 UTC | |
by AliceQuint (Initiate) on May 27, 2008 at 15:40 UTC |