http://qs321.pair.com?node_id=723813


in reply to Reading from terminal

Without a code example it's hard to know why it's working the way it is instead of the way you want.

The first thing that comes to mind, is how are you executing the external program? System or backticks?

Try using backticks and assigning the results to a variable; i.e.:

my $passwd = `cat /etc/passwd`;

Note that those are backticks (`) which share the same key as the tilde (~)(at least on my keyboard, but I'm not a Mac user, so YMMV), not single quotes (').