Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending an enter to a system call

Status
Not open for further replies.

countercycle

Programmer
Aug 21, 2003
2
US
I'm trying to start a system command, then simulate an enter key being pressed (activestate 5.6.1). I've come up with this code, but it doesn't quite work.

open(MORE,"|more readme");
print MORE "\n";
close(MORE);

Can anybody help?
 
If you dont want to use an extra module, you can send an enter key this way.

print chr 13

which prints the enter key.

ex:

my $enter = chr 13;
open(MORE,"|more readme");
print $enter;
close(MORE);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top