RE: Parsing test file question
James wrote, on Thursday, March 06, 2003 23:15 : I have a test file which conatin words separated by : comma and I would like to process and print the result : to an ouput file. The output file should only have at : most 32 characters per line.If the line read is more : than 32 char, then the rest should be printed in the : next line. Can anybody help me with this? Look at the module Text::Wrap. It will do what you want. Joe == Joseph P. Discenza, Sr. Programmer/Analyst mailto:[EMAIL PROTECTED] Carleton Inc. http://www.carletoninc.com 574.243.6040 ext. 300fax: 574.243.6060 Providing Financial Solutions and Compliance for over 30 Years * Please note that our Area Code has changed to 574! * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: :Telnet Script Issue
Ok, I used Input_Log to debug, and I got the following: User Access Verification Username: glupi Password: br01-nyc1.nyenable Password: br01-nyc1.ny#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is is variably subnetted, 2 subnets, 2 masks C is directly connected, FastEthernet1/0 Cis directly connected, Loopback1 is subnetted, 1 subnets S [1/0] via [1/0] via is directly connected, FastEthernet0/0 is subnetted, 1 subnets Cis directly connected, FastEthernet1/0 C is directly connected, FastEthernet0/0 S* 0.0.0.0/0 [1/0] via br01-nyc1.ny# The script is doing exactly what I want it to do, with the exception of printing the output of the command. Is it possible that the script doesn't recognize the occurence of br01-nyc1.ny# as the end of the command output? If that is the case, how do I tell the script run the command show ip route, and when you see br01-nyc1.ny# again the output is finished? Thanks for the help. -Original Message- From: Allegakoen, Justin Devanandan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 7:23 PM To: [EMAIL PROTECTED] Subject: RE: :Telnet Script Issue ---8-- I was able to resolve my issues with Net::Telnet not working, thank you to everyone who replied to my post. Now I have something different. Below is a script that I wrote, it telnets to a Cisco router, goes into enable mode, and is supposed to print the output of a show ip route command. The issue is that the script times out at line 13, which is where it is supposed to send the command. I know that the telnet is connecting, and the script is authenticating, because if it wasn't it would time out way before line 13 (at least I hope that is correct). Can anyone tell me why it is timing out? I thought that maybe it was because there was no newline at the end of line 13, but supposedly when using cmd there is an automatic newline appended to the string. I would appreciate any help. ---8-- 99% of time out issues occur with Net::Telnet because the prompt was not matched correctly. Do a search on AS mailing lists for Net::Telnet and you will see other peoples woes with this. What I suggest you do is turn the logging on, and see what the prompt actually is. (Its also a good idea to turn strict and warnings on):- use strict; use warnings; my $t = new Net::Telnet (Timeout = 40, Dump_Log = C:/Temp/Err.txt); If you cant match the prompt that it requires, send us the output and one of us will write a regexp for you. HTH Just in ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: :Telnet Script Issue
Guy Lupi wrote: Is it possible that the script doesn't recognize the occurence of br01-nyc1.ny# as the end of the command output? Yes, the prompt could have been set incorrectly. If that is the case, how do I tell the script run the command show ip route, and when you see br01-nyc1.ny# again the output is finished? That's what the prompt is for! $t-cmd() uses the prompt to determine the end of output. Set your prompt to a proper value and it will work. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: :Telnet Script Issue
Excellent, I set the prompt value to be correct, and it now works well. Thanks for the help! -Original Message- From: Thomas, Mark-BLS CTR [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:57 AM To: Lupi, Guy; [EMAIL PROTECTED] Subject: RE: :Telnet Script Issue Guy Lupi wrote: Is it possible that the script doesn't recognize the occurence of br01-nyc1.ny# as the end of the command output? Yes, the prompt could have been set incorrectly. If that is the case, how do I tell the script run the command show ip route, and when you see br01-nyc1.ny# again the output is finished? That's what the prompt is for! $t-cmd() uses the prompt to determine the end of output. Set your prompt to a proper value and it will work. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
HTML::Mason and mod perl on windows
Does anyone know where I can find some good useable documentation on setting up HTML::Mason and mod perl on windows with Apache? I installed both via ppm and that went good, but im having trouble adding the needed lines to the httpd.conf file.. and so on.. Thanks in advance. Steve. _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: HTML::Mason and mod perl on windows
At 02:17 PM 3/7/2003 +, steve silvers wrote: Does anyone know where I can find some good useable documentation on setting up HTML::Mason and mod perl on windows with Apache? I installed both via ppm and that went good, but im having trouble adding the needed lines to the httpd.conf file.. and so on.. You did look at http://www.masonhq.com/docs/manual/Admin.html#basic_configuration_via_httpd_co Didn't you? Tobias ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Parsing test file question
- Original Message - From: James [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 06, 2003 22:14 Subject: Parsing test file question Hi all, I have a test file which conatin words separated by comma and I would like to process and print the result to an ouput file. The output file should only have at most 32 characters per line.If the line read is more than 32 char, then the rest should be printed in the next line. Can anybody help me with this? This is the input file: ### INPUT FILE AA1234,AA3134,AA1345,AA091,A2,AA1206,AAA0912,AA8731 BB1344 C1,CC1299,CC2425,0965,C4,CC1400,CCC1345,CC0012,CC231 DD6623,DD1200,DDD2456,DDD1123,D2,DD1206,D1,DD0011,D3 EE5609,EE1200 END ## And I want to create an ouput file like this(print the word read but cannot have more than 32, if more print it in the next line): OUTPUT FILE # AA1234,AA3134,AA1345,AA091,A2, AA1206,AAA0912,AA8731 BB1344 C1,CC1299,CC2425,0965,C4, CC1400,CCC1345,CC0012,CC231 DD6623,DD1200,DDD2456,DDD1123, D2,DD1206,D1,DD0011,D3 EE5609,EE1200 END James, Assuming that you have opened the files, have a loop that reads the input file line by line and assigns the current line to $_ after chomping it, and that the output file filehandle is FHO: if (length($_) 32) {print(FHO substr($_,0,32),\n); print(FHO substr($_,31),\n)} else {print(FHO $_\n} Dirk Bremer - Systems Programmer II - ESS/AMS - NISC St. Peters USA Central Time Zone 636-922-9158 ext. 8652 fax 636-447-4471 [EMAIL PROTECTED] www.nisc.cc ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
How to tell if a machine is a laptop
Is there a way to tell if a machine is a laptop or not? We need to be able to discriminate so that some scripts will behave differently depending on the type of machine. Thank you in advance. Steven Thomson AFRL E-Mail and Lan Support 505-853-3148 [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Web server live text question
Hello All, Does anybody know of a perl module(s) that could provide a solution where a web server listens on a port (not 80) for an ASCII stream and then would be able to write the text to an html file for viewing in real-time? The page would add text by refreshing itself. I'm looking at the feasibility of a solution. It would run on a Win 2k Server. Thanks in Advance, Mark This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message. Thank you. WordWave, Capturing the Power of the Spoken Word http://www.wordwave.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs