in reply to Re: STDIN problemo
in thread STDIN problemo
re line 8 for windows: perhaps con: or CON: (either appears to work on the rather dated W32 box available right now):
open STDIN, "<", "/con:" or die "Couldn't open console: $!";
To execute a command * found in $user_input simply insert
system($user_input);
after line 11 of almut's elegant no-module solution -- which observation is in no way intended to deprecate ikegami's earlier reply using a module which also appears to fit the OP's needs. Both are easily extensible./p>
Update: * ...but this fails with some commands, notably with cd or chdir, although it does "work" with commands like dir or perl -c script.pl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: STDIN problemo
by ccdoub (Initiate) on Dec 19, 2009 at 03:27 UTC |