I have this block of code that i am running.
open(LIST,$List) or die "Can't read $List: $!";
while (<LIST>) {
chomp(my $Server = $_);
my $source1 = "C:/ChPass/phrase.txt";
my $dest1 = "//$Server/c\$/temp/phrase.txt";
print $dest1;
my $command = qq(copy "$source1" "$dest1") or die "Couldn't copy $
+source1: $!";
$command =~ s#/#\\#g;
system $command;
print " I finished the first command.\n";
my $source2 = "C:/ChPass/ChPass.exe";
my $dest2 = "//$Server/c\$/temp/ChPass.exe";
my $command2 = qq(copy "$source2" "$dest2") or die "Couldn't c
+opy $source2: $!";
$command2 =~ s#/#\\#g;
print $command2;
system $command2;
print " I finished the second command.\n";
print $Server . "\n";
I am then calling on the exe that i copied over which is a compiled perl script. It is waiting for a server name and a caridge return. so i put $Server after the chpass.exe but i need a way to put in a caridge return so that it can see the server name.
system("//$Server/c\$/temp/ChPass.exe $Server");
print " I called the executable and it completed.\n";
}
Can someone tell me how i can simulate me hitting enter after the exe sees the server name. Thanks in advance.
Ray
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.