I don't know exactly how Sametime expects to get it's login, can you be more specific what the program does? Does it output a prompt, like Login:? Usually to interact with a program, the Expect
module is usually recommended, google for perl Expect
for sample code.
In a very simple situation, you may be able to get by with IPC::Open3, which opens the program, and gives you pipes to write to, and read from, the executable.
A simple example:
# you would run Sametime here, instead of bash
my $pid=open3(\*IN,\*OUT, \*ERR , '/bin/bash');
# set \*ERR to 0 to send STDERR to STDOUT
# in your case, print the login name here
my $cmd = 'date';
#send cmd to bash
print IN "$cmd\n";
my $result = <OUT>;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||