how do i keep carriage returns from being reflected in my 'print OUT' file??? i am trying to create a batch file, only the responses are being put on a new line, and we all know that does not work with batch files... here is my script someone HELP!!! i will give you credit in my script
(*script follows)
---------------------------------------------
#!/usr/local/bin/perl
#this is intended to prompt the user for input and dump
#the responses into a batch file that can be used to update
#or restore the route table. if the route table is built using this
#script then it can be restored simply by running the batch file
#generated by the output.
#
#this script is open source, you can steal it, modify it, just
#do the right thing and give credit to Erich V when using it.
#
#the only requirements are: windows 2000 box and the PERL runtime
#files installed... have fun! bug reports to erichv123@hotmail.com
#
#-------------------------------
#display welcome message
print "\nWelcome to the route-table builder. \nThis will prompt you for information to build your route-table. \nAfter the program terminates, run the batch file that it creates to install \nyour route-table. Restoring the table is as simple as running the batch file \nagain.\n\n";
#ask the user what they wanna name their file
print "\nEnter a name for the batch file that will be created: ";
$file = <STDIN>;
#assign the name of the file given by the user as the OUT variable to write to
$OUT = "$file";
#ask the user if the route is to be persistent
print "Will this entry be a persistent route? (Y|N)";
$persist = <STDIN>;
#ask the user what network is the destination network
print "Enter the NETWORK IP ADDRESS of the destination network (ie. 192.168.1.0): ";
$dest = <STDIN>;
#ask the user for the netmask
print "Enter the SUBNET MASK of the DESTINATION NETWORK (ie. 255.255.255.0): ";
$mask = <STDIN>;
#ask the user for the gateway
print "Enter the DEFAULT GATEWAY used to get to the DESTINATION NETWORK (ie. 192.168.1.1): ";
$gw = <STDIN>;
#ask the user for the metric
print "Enter the METRIC (COST) of this route (ie. 1): ";
$metric = <STDIN>;
#stop talking to the user, they do not know wtf they are talking about anyway
#get the persist variable and assign a -p or nothing to it
if ($persist=="y"
{
$p = " -p";
} else {
$p = "";
}
#finally, open (or create) the batch file
open OUT, ">>$OUT";
#write to the batch file
print OUT "route$p add $dest $mask $gw $metric";
(*script follows)
---------------------------------------------
#!/usr/local/bin/perl
#this is intended to prompt the user for input and dump
#the responses into a batch file that can be used to update
#or restore the route table. if the route table is built using this
#script then it can be restored simply by running the batch file
#generated by the output.
#
#this script is open source, you can steal it, modify it, just
#do the right thing and give credit to Erich V when using it.
#
#the only requirements are: windows 2000 box and the PERL runtime
#files installed... have fun! bug reports to erichv123@hotmail.com
#
#-------------------------------
#display welcome message
print "\nWelcome to the route-table builder. \nThis will prompt you for information to build your route-table. \nAfter the program terminates, run the batch file that it creates to install \nyour route-table. Restoring the table is as simple as running the batch file \nagain.\n\n";
#ask the user what they wanna name their file
print "\nEnter a name for the batch file that will be created: ";
$file = <STDIN>;
#assign the name of the file given by the user as the OUT variable to write to
$OUT = "$file";
#ask the user if the route is to be persistent
print "Will this entry be a persistent route? (Y|N)";
$persist = <STDIN>;
#ask the user what network is the destination network
print "Enter the NETWORK IP ADDRESS of the destination network (ie. 192.168.1.0): ";
$dest = <STDIN>;
#ask the user for the netmask
print "Enter the SUBNET MASK of the DESTINATION NETWORK (ie. 255.255.255.0): ";
$mask = <STDIN>;
#ask the user for the gateway
print "Enter the DEFAULT GATEWAY used to get to the DESTINATION NETWORK (ie. 192.168.1.1): ";
$gw = <STDIN>;
#ask the user for the metric
print "Enter the METRIC (COST) of this route (ie. 1): ";
$metric = <STDIN>;
#stop talking to the user, they do not know wtf they are talking about anyway
#get the persist variable and assign a -p or nothing to it
if ($persist=="y"
$p = " -p";
} else {
$p = "";
}
#finally, open (or create) the batch file
open OUT, ">>$OUT";
#write to the batch file
print OUT "route$p add $dest $mask $gw $metric";