ravenpi has asked for the
wisdom of the Perl Monks concerning the following question:

Hi, all. I'm attempting to throw some characters into the keyboard buffer to "persuade" a reluctant DOS program to interact with me. It seems as if Win32::Console is the way to go about this, specifically with WriteInput(). That being said, I'm afraid I am below the lowliest of acolytes in the Great Perl Hierarchy, and my attempts to implement this with the (very) sparse documentation available have been futile. (I've been receiving UNDEF upon invocation, which means I goofed.) If someone could show me a functional snippet -- always assuming I'm not entirely barking up the wrong tree -- I'd be eternally grateful for the glimpse at Enlightenment.

Specifically, i was interacting with the LPR printing program from the command prompt. You didn't cite any specific code up there so I'm not sure exactly what you are trying, but I got LPR to interact with me on the command line with some form of the code below:

Awesome! An approach I hadn't even considered -- that'll do the trick. Thanks so much for a functional template; I should be able to warp that to my means. (And, for the record, I hadn't posted my code 'cause it could barely have been called code -- when I'm as lost as I was, it more closely resembles a grasping-at-straws approach than anything structured.)

You might be embarrassed to have anyone see your code, but it's still a good idea to post code. Don't worry, no-one's here to pick on someone just because they're starting out or otherwise lacking knowledge.

Many problems aren't where the questioner thinks, so relevant information is left out. This will cost you and the people helping you of valuable time.

Some problems are easily recognized by inspection. No code ... no inspection! You're depriving someone of the chance to give you an immediately useful answer. Otherwise, it may take several exchanges to get the relevant information.

Many people will skip nodes without code, as they don't want to create an example from scratch. Many times it's much easier to fix something that's already there. Additionally, many monks are interested in helping those who make an effort. If the problem's not important enough for you to give a good, clear problem statement, then why is it worth my time? There's no shortage of questions to choose from. A chunk of code goes a long way in this regard (think "sweat equity").

Seeing your code gives a monk a general idea as to your skill level. That helps them not give advice at too high or too low a level. It also gives them the opportunity to offer advice on a particular concept that you're not clear on, or show you an interesting coding technique that could save you time.