RE: Perl2exe syntax for module inclusion.
Great. I'll give that a try. Phil. |-+---> | | "Adam Frielink" | | | <[EMAIL PROTECTED]> | | | Sent by:| | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 17/09/02 15:55 | | | | |-+---> >--| | | | To: "Perl-Win32-Users \(E-mail\)" <[EMAIL PROTECTED]>| | cc: | | Subject: RE: Perl2exe syntax for module inclusion. | >--| You may want to try their official email address. The Mx records may not be configured for dynamicstate.com to send the email to the correct place. [EMAIL PROTECTED] is the email on their website for support. Indy has always responded in a timely fashion to questions, so I believe he may have never received your initial query. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > Phil Ritchie > Sent: Tuesday, September 17, 2002 6:46 AM > To: [EMAIL PROTECTED] > Subject: RE: Perl2exe syntax for module inclusion. > > > > [Obviously so mad that I replied to the wrong thread initially.] > > Okay now I'm getting disheartened. Got no response from DynamicSTATE at > [EMAIL PROTECTED] After spending more time on trial and error, > inserting "use lib '/Perl/lib'; and use '/Perl/site/lib';" to the head of > my script now means it compiles with Perl2exe. However, when I try to run > the executable I get: > > "Perl 5.00564 required--this is only version 5.00503, stopped at > PERL2EXE_STORAGE/lib.pm line 3. > BEGIN failed--compilation aborted at PERL2EXE_STORAGE/lib.pm line 3. > BEGIN failed--compilation aborted at D:\Dev\Perl\Balancer.pl line 2." > > I definitely, absolutely, no questions asked have Perl 5.6.0.613 > installed. > Don't know where to go from here. > > Phil. > > > > > |-+> > | | "Stovall, Adrian | > | | M." | > | || | urez.com>| > | || > | | 06/09/02 17:35 | > | || > |-+> > > >- > -| > | >| > | To: "Phil Ritchie" <[EMAIL PROTECTED]> >| > | cc: >| > | Subject: RE: Perl2exe syntax for module inclusion. >| > > >- > -| > > > > > I changed some very small things (added a shebang line, for one)... > > Recurse.pm should be in perl/lib/file, not in perl/site/lib/file (that's > where I stuck it, because that's the directory that the other > FIle::something modules were located) > > Give it another try after moving recurse.pm...perl2exe worked fine for > me with it this way > > -Original Message- > From: Phil Ritchie [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 06, 2002 11:22 AM > To: Stovall, Adrian M. > Subject: RE: Perl2exe syntax for module inclusion. > > > > Code attached. Recurse.pm is located on my system in perl/site/lib/file > and warnings is located in perl/lib. > > (See attached file: Folderwalker.zip) > > Phil. > > > > |-+> > | | "Stovall, Adrian | > | | M." | > | || | urez.com>| > | || > | | 06/09/02 15:51 | > | || > |-+> > > >
Re: perldoc fickleness
- Original Message - From: "$Bill Luebkert" <[EMAIL PROTECTED]> To: "Sisyphus" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, September 18, 2002 1:45 PM Subject: Re: perldoc fickleness > Sisyphus wrote: > > > > It finally all made sense - when I grasped the basics of what's happening. > > > > When I run 'perldoc' it comes up one page at a time with 'more' - and once > > I've got to the bit I > > want to read, I then kill it with Ctrl-C. > > Try typing 'q' instead. > Yes - that solves all problems. It kills perldoc, but first deletes the temporary files that are in use. Can't ask for more than that :-) Thanks Bill. I had tried finding any open handles by inserting print statements before all 'open' calls and after all 'close' calls but couldn't find any. All I found was that after the first page had been displayed, OUT had been opened and closed. At that point I was hitting Ctrl_C. Is there some better way of determining if there are any open handles at a specific point in a script (preferably a way that doesn't involve specifying the names of any handles) ? If so, a pointer to it might be handy for future use. I also tried some unlink's at various points in perldoc.bat - but they were either being encountered too early or too late. Anyway that's academic, now. Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perldoc fickleness
Sisyphus wrote: > > It finally all made sense - when I grasped the basics of what's happening. > > When I run 'perldoc' it comes up one page at a time with 'more' - and once > I've got to the bit I > want to read, I then kill it with Ctrl-C. Try typing 'q' instead. > When I do that the temporary file is not deleted - it only gets deleted if > 'perldoc' terminates in the normal fashion. > So, the *next* time I run 'perldoc' there's a chance that the (arbtrarily) > designated temporary file already exists - in which case O_EXCL kills it. > > So I thought I'd get real cute and write into perldoc.bat a sigint handler > routine that unlinks the temporary file and exits when Ctrl-C is hit. > And it works beautifully - except that it won't delete the file. > > I'm not sure if that shortcoming exists because I'm reading the file that > I'm trying to delete - or because 'unlink' is simply something that can't be > done on Win32 from a sig-int-handler routine. (I can't find any open > handles, so I suspect it's the latter . wouldn't be hard to check if I > can be bothered.) unlike UNIX, Windoze doesn't seem to be able to delete files that are in use = pretty pathetic. > Anyway, seems there's a few simple options for dealing with the problem. > > I find it interesting that when my perldoc call fails, then the file that > O_EXCL refused to allow to be opened, gets deleted anyway. Can't see the > point of having an 'O_EXCL' there . maybe it serves some purpose for a > different OS. (I guess, for me, it has served in keeping down the number of > 'perldoc1.*' files that exist in my temp folder.) There should be no need for O_EXCL in this situation. > Here's the handler code I tried, btw. > > $SIG{INT} = \&my_handler; > > sub my_handler{ > print "Aborting\n"; Try checking to see if the file exists here - can't delete what isn't there. > #system("del perldoc1.*"); # "Can't spawn cmd.exe" > #chmod 0666, $my_tmp; # doesn't help > my $u = unlink $my_tmp; # $my_tmp is the temp file > if($u) {print "$my_tmp deleted\n"} > else {print "Cleanup FAILED!!!\n"} > kill 'ABRT', $$; > } > > prints: > Aborting > Cleanup FAILED!!! You could also try closing OUT or TMP or whatever FH is being used prior to the unlink. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perldoc fickleness
- Original Message - From: "James E Keenan" <[EMAIL PROTECTED]> > > > > And now that I've read the sysopen documentation, I've decided it's > cleaner > > to remove the O_EXCL than it is to unlink. Works fine, also. > > > > I'm now left wondering how come this is not a common problem, and how come > > it was intermittent ? > > It appears that problems involving 'O_EXCL' are so obscure that that term > has only been mentioned in 8 discussion threads on this list since August > 2000! > > Jim Keenan It finally all made sense - when I grasped the basics of what's happening. When I run 'perldoc' it comes up one page at a time with 'more' - and once I've got to the bit I want to read, I then kill it with Ctrl-C. When I do that the temporary file is not deleted - it only gets deleted if 'perldoc' terminates in the normal fashion. So, the *next* time I run 'perldoc' there's a chance that the (arbtrarily) designated temporary file already exists - in which case O_EXCL kills it. So I thought I'd get real cute and write into perldoc.bat a sigint handler routine that unlinks the temporary file and exits when Ctrl-C is hit. And it works beautifully - except that it won't delete the file. I'm not sure if that shortcoming exists because I'm reading the file that I'm trying to delete - or because 'unlink' is simply something that can't be done on Win32 from a sig-int-handler routine. (I can't find any open handles, so I suspect it's the latter . wouldn't be hard to check if I can be bothered.) Anyway, seems there's a few simple options for dealing with the problem. I find it interesting that when my perldoc call fails, then the file that O_EXCL refused to allow to be opened, gets deleted anyway. Can't see the point of having an 'O_EXCL' there . maybe it serves some purpose for a different OS. (I guess, for me, it has served in keeping down the number of 'perldoc1.*' files that exist in my temp folder.) Here's the handler code I tried, btw. $SIG{INT} = \&my_handler; sub my_handler{ print "Aborting\n"; #system("del perldoc1.*"); # "Can't spawn cmd.exe" #chmod 0666, $my_tmp; # doesn't help my $u = unlink $my_tmp; # $my_tmp is the temp file if($u) {print "$my_tmp deleted\n"} else {print "Cleanup FAILED!!!\n"} kill 'ABRT', $$; } prints: Aborting Cleanup FAILED!!! Thanks guys. Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Using Pack and Unpack
Carl Jolley <[EMAIL PROTECTED]> wrote: > Two problems, when the index file is created, the file needs to > be opened for output, instead of: > open (I, "index.idx"); > you need: > open (I, ">index.idx") || die can\'t open output file index.idx"; Oops. Of course, you are right. > Second problem: > The perl Cookbook assumes use of a Unix OS. On a Windows OS > files that contain binary data, like your index file, require > use of the binmode function. > After the open (INDEX, "$index_file_name") or die ("Can't open $!\n"); > insert a: binmode(INDEX); > [EMAIL PROTECTED] > All opinions are my own and not necessarily those of my employer That's the ticket. Thanks a bunch. Paul Flint Japanese to English Translation Kawasaki Japan ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: perldoc fickleness
On Tue, 17 Sep 2002 13:56:23 +1000, "Sisyphus" <[EMAIL PROTECTED]> wrote with regard to: Re: perldoc fickleness: > > And now that I've read the sysopen documentation, I've decided it's cleaner > to remove the O_EXCL than it is to unlink. Works fine, also. > > I'm now left wondering how come this is not a common problem, and how come > it was intermittent ? It appears that problems involving 'O_EXCL' are so obscure that that term has only been mentioned in 8 discussion threads on this list since August 2000! Jim Keenan ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Using Pack and Unpack
On Tue, 17 Sep 2002, Paul Flint wrote: > I'm getting incorrect results from recipe 8.8 in the Perl Cookbook. > > I'm building an index of offset positions for lines in a file (3 MB), > which I'm supposed to be able to use to access any line in that file. > > I use Code A to build the index. (taken from Perl Cookbook, see below) > > But when I use Code B (see below) to access it, I get back random > results if accessing lines higher than 90 or so. > > I think that the offset value becomes too big to store in a pack("N", > $offset) and the index creator starts kicking out random numbers, which > of course cause line_with_index to read random lines of the file. > > Does this sound correct? And if so, what can I do about it? A friendly > pointer to the correct documentation would help. I can't seem to find it > in my Web searches. > > TIA, > Paul Flint > > Code A > === > open (D, "fulltext.txt"); > open (I, "index.idx"); > > build_index(*D, *I); > > sub build_index{ > my $data_file = shift; > my $index_file = shift; > my $offset = 0; > > while (<$data_file>){ > print $index_file pack("N", $offset); > $offset = tell($data_file); > } #while > } #build_index > > # END Code A > > Code B > sub line_with_index{ > my $data_file_name = shift; > my $index_file_name = shift; > my $line_number = shift; > > open (DATA, "$data_file_name") or die ("Can't open $!\n"); > open (INDEX, "$index_file_name") or die ("Can't open $!\n"); > > my $size; # size of an index entry > my $i_offset; # offset into the index of the entry > my $entry; # index entry > my $d_offset; # offset into the data file > > $size = length(pack("N", 0)); > $i_offset = $size * ($line_number-1); > seek(INDEX, $i_offset, 0) or return; > read(INDEX, $entry, $size); > $d_offset = unpack("N", $entry); > seek(DATA, $d_offset, 0); > > return scalar (<$data_file>); > > } # line_with_index > > # END Code B > Two problems, when the index file is created, the file needs to be opened for output, instead of: open (I, "index.idx"); you need: open (I, ">index.idx") || die can\'t open output file index.idx"; Second problem: The perl Cookbook assumes use of a Unix OS. On a Windows OS files that contain binary data, like your index file, require use of the binmode function. After the open (INDEX, "$index_file_name") or die ("Can't open $!\n"); insert a: binmode(INDEX); [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Read list of servers from a file???
Hello perl gurus, I have a Perl script that I use to search for files of type *.mdb. I can currently search only 1 machine at a time. I need to search the entire network though. I have another script that generates a list of all servers on the network (120 +/-). I have tried unsuccessfully to modify the search script to open the servers.txt file and read through it 1 server at a time. passing each server name to the search routine. I have been unsuccessful for 2 days! Any guidance would be much appreciated. Here is the search script below: #! D:\Perl\bin\perl.exe -w eval 'exec D:\Perl\bin\perl.exe -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir= *File::Find::dir; *prune = *File::Find::prune; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, 'NTSERVER /c$'); exit; sub wanted { print "$File::Find::name\n" if /\.mdb$/; } Steve Doherty ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: NET::Telnet
First, if you are telnetting from a non Windoze PC, you must turn off NTLM authentication on the host. This works on an NT box: use Net::Telnet; use strict; use warnings; my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); my @jim=""; my $frank=""; $telnet->open('192.168.174.108'); $telnet->waitfor('/Username: $/i'); $telnet->print('Administrator'); $telnet->waitfor('/Password: $/i'); $telnet->print('12345'); $telnet->waitfor('/\>$/i'); $telnet->print('"show users"'); @jim=$telnet->waitfor('/\>$/'); Its similar for W2K except that Username is login. > -Original Message- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 12:20 AM > To: [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > Jitranda, > > I gave up trying to figure out what to use as a prompt for > Net::Telnet when > connecting to Windows' telnet server. > > Maybe someone out there will enlighten us both. > > Tom > > > > > "Jitendra Soam" <[EMAIL PROTECTED]>@listserv.ActiveState.com > on 09/17/2002 > 10:38:52 AM > > Sent by:[EMAIL PROTECTED] > > > To:<[EMAIL PROTECTED]> > cc: > Subject:RE: NET::Telnet > > > > Thanks. > > But the what should be used as prompt? > > > > -Original Message- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:01 PM > To: [EMAIL PROTECTED] > Subject: Re: NET::Telnet > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > Is it possible to use Net::Telnet module to telnet into Windows > > machine running Microsoft Telnet Service.. > > In theory, yes, _provided_ the Telnet service is set up to do > username/password authentication. This is not the default. > > In practice, there appear to be significant problems figuring out what > you > should tell it the prompt string is, because Microsoft embeds > all sorts > of > escape sequences in it. > > > and start Any program like Notepad on target machine? > > In theory, yes. In practice, of course, Notepad displays on the target > machine's desktop, which probably does you as the owner of the telnet > link > no good at all. > > Tom Wyant > > > > This communication is for use by the intended recipient and contains > information that may be privileged, confidential or copyrighted under > applicable law. If you are not the intended recipient, you are hereby > formally notified that any use, copying or distribution of > this e-mail, > in whole or in part, is strictly prohibited. Please notify the sender > by return e-mail and delete this e-mail from your system. Unless > explicitly and conspicuously designated as "E-Contract Intended", > this e-mail does not constitute a contract offer, a contract > amendment, > or an acceptance of a contract offer. This e-mail does not constitute > a consent to the use of sender's contact information for direct > marketing > purposes or for transfers of data to third parties. > > Francais Deutsch Italiano Espanol Portuges Japanese > Chinese Korean > > http://www.DuPont.com/corp/email_disclaimer.html > > > ___ > 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 > > > > > > This communication is for use by the intended recipient and contains > information that may be privileged, confidential or copyrighted under > applicable law. If you are not the intended recipient, you are hereby > formally notified that any use, copying or distribution of > this e-mail, > in whole or in part, is strictly prohibited. Please notify the sender > by return e-mail and delete this e-mail from your system. Unless > explicitly and conspicuously designated as "E-Contract Intended", > this e-mail does not constitute a contract offer, a contract > amendment, > or an acceptance of a contract offer. This e-mail does not constitute > a consent to the use of sender's contact information for > direct marketing > purposes or for transfers of data to third parties. > > Francais Deutsch Italiano Espanol Portuges Japanese > Chinese Korean > > http://www.DuPont.com/corp/email_disclaimer.html > > > ___ > 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
Yes, it works fine. > -Original Message- > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 9:00 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: NET::Telnet > > > Is it possible to use Net::Telnet module to telnet into > Windows machine > running Microsoft Telnet Service..and start Any program like > Notepad on > target machine? > > Thanks > ___ > 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: Using Pack and Unpack
"Warkentin, Brad" <[EMAIL PROTECTED]> wrote: > Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > postulates: >> Because of the "text" mode translation, DOSish perls have >> limitations in using "seek" and "tell" on a file accessed >> in "text" mode. > True, however I thought the limitation was that you could only > "seek" to locations provided by "tell". Given that the index is > generated using tell, seeking to the locations should work, > independant of the stupid \015\012 crap. That's correct. The example does a "tell" on the main file, and puts the results in the index. But then it computes "seek" values on the index. You could get around that by doing a "tell" every time you write the index, and keeping _them_ somewhere. Of course, if you keep them in a file (a meta-index), you rapidly disappear into an infinite regress. Tom This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portuges Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Installing Libwww-perl on ASPerl 5.6.1 Build 633 with PPM3
Title: RE: Installing Libwww-perl on ASPerl 5.6.1 Build 633 with PPM3 I am using ppm version 2.1.5 and it works just fine with Perl 5.6.1 Build 633 have you tried doing a verify --upgrade libwww-perl from the ppm prompt? -Original Message- From: Cutts III, James H. [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 10:51 AM To: Perl Win32 Users (E-mail) Subject: Installing Libwww-perl on ASPerl 5.6.1 Build 633 with PPM3 I have had considerable trouble installing libwww-perl on my AS Perl 5.6.1 Build 633 on WinNT 4.0. I had been having some strange configuration problems with Perl, so I completely uninstalled AS Perl 5.6.1 Build 62x and installed AS Perl 5.6.1 Build 633. The installation went well and resolved all my configuration problems. I was able to get all the packages that I had been using, except for libwww-perl. I have switched to PPM3 and as long as I remember the new syntax, I like the app. Here is what I get when I try to use PPM3 to install libwww-perl: >D:\Projects\Perl>ppm3 >PPM - Programmer's Package Manager version 3.0.1. >Copyright (c) 2001 ActiveState SRL. All Rights Reserved. > >Entering interactive shell. Using Term::ReadLine::Stub as readline >library. > >Profile tracking is not enabled. If you save and restore profiles >manually, your profile may be out of sync with your computer. See 'help >profile' for more information. > >Type 'help' to get started. > >ppm> search libwww >Searching in Active Repositories > 1. libwww-perl [5.48] ActiveState Package Repository >[http://ppm-ia.ActiveS~ >ppm> install libwww-perl >Error: Package 'libwww-perl' not found on server. Please 'search' for >it first. >ppm> I search for the package, find the package and ask PPm3 to install the package, and it replies - "'search' for it first." I usually respond with something impolite and drop the matter. This morning after reading a note about libwww-perl and being available on Active State, I decided to try again. I got the above results from PPM3. So then I tried PPM. PPM has been non functioning since the install of Build 633. PPM spews out at me: >D:\Projects\Perl>ppm >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at >D:/Bin/Perl/site/ lib/PPM.pm line 1684. Element 'IMPLEMENTATION' must >contain a 'CODEBASE' element. at D:/Bin/Perl/site/ lib/PPM.pm line >1684. Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at >D:/Bin/Perl/site/ lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >PPM interactive shell (2.1.6) - type 'help' for available commands. >PPM> search libwww >PPM> The PPM prompt is returned immediately after the "search libwww". Any suggestions for getting libwww-perl installed or for getting PPM working again? Thanks. James H. Cutts III Integrated Technology Services Computer Project Manager Research and Education Support Phone: (573) 882-6181 University of Missouri - Columbia FAX: [573] 884=8192 DC017.00, 265H Quarterdeck Columbia, MO 65212 E-Mail: [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Using Pack and Unpack
Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] postulates: > Paul Flint <[EMAIL PROTECTED]> wrote: > > > I'm getting incorrect results from recipe 8.8 in the Perl Cookbook. > > > I'm building an index of offset positions for lines in a file (3 > > MB), which I'm supposed to be able to use to access any line in that > > file. > > > I use Code A to build the index. (taken from Perl Cookbook, see > > below) > > > But when I use Code B (see below) to access it, I get back random > > results if accessing lines higher than 90 or so. > What I think I would try instead is to put the index file > into binary mode right after you open it (hint: > > binmode I; > > ). What I fear is going on is that somewhere along the line > you generate a > byte whose value is 0x10. If that happens under Windows 32 > and you're not > in "binmode", the "C" runtime will "expand" this to 0x13 > 0x10, and at that > point, you're dead in the water. > So am I saying that Tom Christiansen and Nathan Torkington > are wrong and > I'm right? Not really. I don't own a copy of this book, but I suspect > you'll find somewhere in the front matter something about the > target system > being some flavor of Unix. He does address this issue in 8.11 (a couple pages further into the recipes about file access). To be fair he does warn in the preface that they tested on BSD, Linux and SunOS and that some examples may not work on non-POSIX systems. [As you can tell I do own this book... ] > Because of the "text" mode translation, DOSish perls have > limitations in > using "seek" and "tell" on a file accessed in "text" mode. True, however I thought the limitation was that you could only "seek" to locations provided by "tell". Given that the index is generated using tell, seeking to the locations should work, independant of the stupid \015\012 crap. cheers, bj ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
FW: NET::Telnet
Mark, you'd probably win that bet. I just searched back through my notes of the time (what did I do before I got my PDA?) and can't find any mention of having changed the term type. I remember sending a couple of SOSes to the list and don't recall that being in any of the suggested solutions or comments. I'm curious now though, and will keep your response in my suspense list for a rainy day. Would be nice to be able to query those legacy systems instead of having to log in to 'em manually. Glen -Original Message- From: Thomas_M [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 1:49 PM To: 'Moulder, Glen' Subject: RE: NET::Telnet I'll bet you didn't try setting the term type to 'TTY'. - Mark. > -Original Message- > From: Moulder, Glen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 1:42 PM > To: perl-win32-users > Subject: FW: NET::Telnet > > > > Carter, what you're saying may work on Unix systems, but > after 2 weeks of hair-pulling last year, I gave up trying to > use Net::Telnet on legacy Univac and Dec systems. The module > just couldn't handle the odd terminal emulation escape > sequences that were being fed to it (especially on the > Univac) and I was unable to reliably establish and maintain > terminal sessions on those machines. Finally had to "brute > force" ftp files up to those boxes without being able to do > the file existence/status checking planned for in my original > design. Net::Telnet users beware. > > Glen > > > -Original Message- > From: Carter Thompson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 1:22 PM > To: Jitendra Soam; [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > > > The Prompt is a regular expression that matches the commandline prompt > from the remote shell. That means you'll want to match the prompt for > the user you are logging in as. If I log into one of my remote > windows machines through a telnet server and I see I have a > prompt like so, "C:/" I'll need to match that within > my code as prompt. > > If the prompt isn't matched in the time specified in > Timeout then the script will either return false or > die based on what Errmode is set to, return or die respectively. > > NET::Telnet Defaults: > Timeout = 10 > Host = "localhost" > Errmode = "die" > Prompt = "/[\$%#>]$/" # matches most unix shells. > Port = 23 > > This is how you could establish a connection with a > windows machine with NET::Telnet (Untested). > > use strict; > > my $TIMEOUT = 30; > my $PROMPT = "C:/"; > my $HOST = "foobar.foo.com"; > my $USER = "Bob"; > my $PASS = "password"; > > $telnet = Net::Telnet->new( Timeout => $TIMEOUT, > Prompt => $PROMPT, > Host=> $HOST, > Errmode => "return"); > > $telnet->login($USER, $PASS); > > # Test here for success if using "return". > my $msg = $telnet->errmsg(); > if ($msg) { > print "$msg\n"; > $telnet->close; > # do whatever you want here. > } > > > > Hope this helps. > > Cheers, > > Carter. > > > > -Original Message- > > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 7:39 AM > > To: [EMAIL PROTECTED] > > Subject: RE: NET::Telnet > > > > > > > > Thanks. > > > > But the what should be used as prompt? > > > > > > > > -Original Message- > > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 7:01 PM > > To: [EMAIL PROTECTED] > > Subject: Re: NET::Telnet > > > > > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > > > Is it possible to use Net::Telnet module to telnet into Windows > > > machine running Microsoft Telnet Service.. > > > > In theory, yes, _provided_ the Telnet service is set up to do > > username/password authentication. This is not the default. > > > > In practice, there appear to be significant problems figuring > out what > > you should tell it the prompt string is, because Microsoft > embeds all > > sorts of > > escape sequences in it. > > > > > and start Any program like Notepad on target machine? > > > > In theory, yes. In practice, of course, Notepad displays on > the target > > machine's desktop, which probably does you as the owner of > the telnet > > link no good at all. > > > > Tom Wyant > > > > > > > > This communication is for use by the intended recipient and > contains > > information that may be privileged, confidential or > copyrighted under > > applicable law. If you are not the intended recipient, you > are hereby > > formally notified that any use, copying or distribution of this > > e-mail, in whole or in part, is strictly prohibited. Please notify > > the sender by return e-mail and delete this e-mail from > your system. > > Unless explicitly and conspicuously designated as "E-Contract > > Intended", this e-mail does not constitute a contract offe
Installing Libwww-perl on ASPerl 5.6.1 Build 633 with PPM3
I have had considerable trouble installing libwww-perl on my AS Perl 5.6.1 Build 633 on WinNT 4.0. I had been having some strange configuration problems with Perl, so I completely uninstalled AS Perl 5.6.1 Build 62x and installed AS Perl 5.6.1 Build 633. The installation went well and resolved all my configuration problems. I was able to get all the packages that I had been using, except for libwww-perl. I have switched to PPM3 and as long as I remember the new syntax, I like the app. Here is what I get when I try to use PPM3 to install libwww-perl: >D:\Projects\Perl>ppm3 >PPM - Programmer's Package Manager version 3.0.1. >Copyright (c) 2001 ActiveState SRL. All Rights Reserved. > >Entering interactive shell. Using Term::ReadLine::Stub as readline library. > >Profile tracking is not enabled. If you save and restore profiles manually, >your profile may be out of sync with your computer. See 'help profile' for >more information. > >Type 'help' to get started. > >ppm> search libwww >Searching in Active Repositories > 1. libwww-perl [5.48] ActiveState Package Repository [http://ppm-ia.ActiveS~ >ppm> install libwww-perl >Error: Package 'libwww-perl' not found on server. Please 'search' >for it first. >ppm> I search for the package, find the package and ask PPm3 to install the package, and it replies - "'search' for it first." I usually respond with something impolite and drop the matter. This morning after reading a note about libwww-perl and being available on Active State, I decided to try again. I got the above results from PPM3. So then I tried PPM. PPM has been non functioning since the install of Build 633. PPM spews out at me: >D:\Projects\Perl>ppm >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >Element 'IMPLEMENTATION' must contain a 'CODEBASE' element. at D:/Bin/Perl/site/ >lib/PPM.pm line 1684. >PPM interactive shell (2.1.6) - type 'help' for available commands. >PPM> search libwww >PPM> The PPM prompt is returned immediately after the "search libwww". Any suggestions for getting libwww-perl installed or for getting PPM working again? Thanks. James H. Cutts III Integrated Technology Services Computer Project ManagerResearch and Education Support Phone: (573) 882-6181 University of Missouri - Columbia FAX: [573] 884=8192 DC017.00, 265H Quarterdeck Columbia, MO 65212 E-Mail: [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: NET::Telnet
Greetings, I too had alot of trouble getting Net::Telnet to work properly, it seemed to continuously stop for no apparent reason, with very poor performance. As well as not being able to make it non-block on win32. I had to eventually write a direct TCP client to get a proper level of performance..etc.. Just my .02, -Lenny -Original Message- From: Moulder, Glen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 1:42 PM To: perl-win32-users Subject: FW: NET::Telnet Carter, what you're saying may work on Unix systems, but after 2 weeks of hair-pulling last year, I gave up trying to use Net::Telnet on legacy Univac and Dec systems. The module just couldn't handle the odd terminal emulation escape sequences that were being fed to it (especially on the Univac) and I was unable to reliably establish and maintain terminal sessions on those machines. Finally had to "brute force" ftp files up to those boxes without being able to do the file existence/status checking planned for in my original design. Net::Telnet users beware. Glen -Original Message- From: Carter Thompson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 1:22 PM To: Jitendra Soam; [EMAIL PROTECTED] Subject: RE: NET::Telnet The Prompt is a regular expression that matches the commandline prompt from the remote shell. That means you'll want to match the prompt for the user you are logging in as. If I log into one of my remote windows machines through a telnet server and I see I have a prompt like so, "C:/" I'll need to match that within my code as prompt. If the prompt isn't matched in the time specified in Timeout then the script will either return false or die based on what Errmode is set to, return or die respectively. NET::Telnet Defaults: Timeout = 10 Host = "localhost" Errmode = "die" Prompt = "/[\$%#>]$/" # matches most unix shells. Port = 23 This is how you could establish a connection with a windows machine with NET::Telnet (Untested). use strict; my $TIMEOUT = 30; my $PROMPT = "C:/"; my $HOST = "foobar.foo.com"; my $USER = "Bob"; my $PASS = "password"; $telnet = Net::Telnet->new( Timeout => $TIMEOUT, Prompt => $PROMPT, Host=> $HOST, Errmode => "return"); $telnet->login($USER, $PASS); # Test here for success if using "return". my $msg = $telnet->errmsg(); if ($msg) { print "$msg\n"; $telnet->close; # do whatever you want here. } Hope this helps. Cheers, Carter. > -Original Message- > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:39 AM > To: [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > Thanks. > > But the what should be used as prompt? > > > > -Original Message- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:01 PM > To: [EMAIL PROTECTED] > Subject: Re: NET::Telnet > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > Is it possible to use Net::Telnet module to telnet into Windows > > machine running Microsoft Telnet Service.. > > In theory, yes, _provided_ the Telnet service is set up to do > username/password authentication. This is not the default. > > In practice, there appear to be significant problems figuring out what > you should tell it the prompt string is, because Microsoft embeds > all sorts > of > escape sequences in it. > > > and start Any program like Notepad on target machine? > > In theory, yes. In practice, of course, Notepad displays on the target > machine's desktop, which probably does you as the owner of the telnet > link no good at all. > > Tom Wyant > > > > This communication is for use by the intended recipient and contains > information that may be privileged, confidential or copyrighted under > applicable law. If you are not the intended recipient, you are hereby > formally notified that any use, copying or distribution of > this e-mail, > in whole or in part, is strictly prohibited. Please notify the sender > by return e-mail and delete this e-mail from your system. Unless > explicitly and conspicuously designated as "E-Contract Intended", > this e-mail does not constitute a contract offer, a contract > amendment, > or an acceptance of a contract offer. This e-mail does not constitute > a consent to the use of sender's contact information for direct > marketing > purposes or for transfers of data to third parties. > > Francais Deutsch Italiano Espanol Portuges Japanese > Chinese Korean > > http://www.DuPont.com/corp/email_disclaimer.html > > > ___ > 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://lists
RE: NET::Telnet
Before anyone else mentions it - please add the "use NET::Telnet" in the example. I told you it was untested. ;-) Carter. > -Original Message- > From: Carter Thompson > Sent: Tuesday, September 17, 2002 10:22 AM > To: Jitendra Soam; [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > > > The Prompt is a regular expression that matches the > commandline prompt from the remote shell. That means > you'll want to match the prompt for the user you are > logging in as. If I log into one of my remote windows > machines through a telnet server and I see I have a > prompt like so, "C:/" I'll need to match that within > my code as prompt. > > If the prompt isn't matched in the time specified in > Timeout then the script will either return false or > die based on what Errmode is set to, return or die > respectively. > > NET::Telnet Defaults: > Timeout = 10 > Host = "localhost" > Errmode = "die" > Prompt = "/[\$%#>]$/" # matches most unix shells. > Port = 23 > > This is how you could establish a connection with a > windows machine with NET::Telnet (Untested). > > use strict; > > my $TIMEOUT = 30; > my $PROMPT = "C:/"; > my $HOST = "foobar.foo.com"; > my $USER = "Bob"; > my $PASS = "password"; > > $telnet = Net::Telnet->new( Timeout => $TIMEOUT, > Prompt => $PROMPT, > Host=> $HOST, > Errmode => "return"); > > $telnet->login($USER, $PASS); > > # Test here for success if using "return". > my $msg = $telnet->errmsg(); > if ($msg) { > print "$msg\n"; > $telnet->close; > # do whatever you want here. > } > > > > Hope this helps. > > Cheers, > > Carter. > > > > -Original Message- > > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 7:39 AM > > To: [EMAIL PROTECTED] > > Subject: RE: NET::Telnet > > > > > > > > Thanks. > > > > But the what should be used as prompt? > > > > > > > > -Original Message- > > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, September 17, 2002 7:01 PM > > To: [EMAIL PROTECTED] > > Subject: Re: NET::Telnet > > > > > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > > > Is it possible to use Net::Telnet module to telnet into Windows > > > machine running Microsoft Telnet Service.. > > > > In theory, yes, _provided_ the Telnet service is set up to do > > username/password authentication. This is not the default. > > > > In practice, there appear to be significant problems > figuring out what > > you > > should tell it the prompt string is, because Microsoft embeds > > all sorts > > of > > escape sequences in it. > > > > > and start Any program like Notepad on target machine? > > > > In theory, yes. In practice, of course, Notepad displays on > the target > > machine's desktop, which probably does you as the owner of > the telnet > > link > > no good at all. > > > > Tom Wyant > > > > > > > > This communication is for use by the intended recipient and > contains > > information that may be privileged, confidential or > copyrighted under > > applicable law. If you are not the intended recipient, you > are hereby > > formally notified that any use, copying or distribution of > > this e-mail, > > in whole or in part, is strictly prohibited. Please notify > the sender > > by return e-mail and delete this e-mail from your system. Unless > > explicitly and conspicuously designated as "E-Contract Intended", > > this e-mail does not constitute a contract offer, a contract > > amendment, > > or an acceptance of a contract offer. This e-mail does not > constitute > > a consent to the use of sender's contact information for direct > > marketing > > purposes or for transfers of data to third parties. > > > > Francais Deutsch Italiano Espanol Portuges Japanese > > Chinese Korean > > > > http://www.DuPont.com/corp/email_disclaimer.html > > > > > > ___ > > 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 > > > ___ > 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
FW: NET::Telnet
Carter, what you're saying may work on Unix systems, but after 2 weeks of hair-pulling last year, I gave up trying to use Net::Telnet on legacy Univac and Dec systems. The module just couldn't handle the odd terminal emulation escape sequences that were being fed to it (especially on the Univac) and I was unable to reliably establish and maintain terminal sessions on those machines. Finally had to "brute force" ftp files up to those boxes without being able to do the file existence/status checking planned for in my original design. Net::Telnet users beware. Glen -Original Message- From: Carter Thompson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 1:22 PM To: Jitendra Soam; [EMAIL PROTECTED] Subject: RE: NET::Telnet The Prompt is a regular expression that matches the commandline prompt from the remote shell. That means you'll want to match the prompt for the user you are logging in as. If I log into one of my remote windows machines through a telnet server and I see I have a prompt like so, "C:/" I'll need to match that within my code as prompt. If the prompt isn't matched in the time specified in Timeout then the script will either return false or die based on what Errmode is set to, return or die respectively. NET::Telnet Defaults: Timeout = 10 Host = "localhost" Errmode = "die" Prompt = "/[\$%#>]$/" # matches most unix shells. Port = 23 This is how you could establish a connection with a windows machine with NET::Telnet (Untested). use strict; my $TIMEOUT = 30; my $PROMPT = "C:/"; my $HOST = "foobar.foo.com"; my $USER = "Bob"; my $PASS = "password"; $telnet = Net::Telnet->new( Timeout => $TIMEOUT, Prompt => $PROMPT, Host=> $HOST, Errmode => "return"); $telnet->login($USER, $PASS); # Test here for success if using "return". my $msg = $telnet->errmsg(); if ($msg) { print "$msg\n"; $telnet->close; # do whatever you want here. } Hope this helps. Cheers, Carter. > -Original Message- > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:39 AM > To: [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > Thanks. > > But the what should be used as prompt? > > > > -Original Message- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:01 PM > To: [EMAIL PROTECTED] > Subject: Re: NET::Telnet > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > Is it possible to use Net::Telnet module to telnet into Windows > > machine running Microsoft Telnet Service.. > > In theory, yes, _provided_ the Telnet service is set up to do > username/password authentication. This is not the default. > > In practice, there appear to be significant problems figuring out what > you should tell it the prompt string is, because Microsoft embeds > all sorts > of > escape sequences in it. > > > and start Any program like Notepad on target machine? > > In theory, yes. In practice, of course, Notepad displays on the target > machine's desktop, which probably does you as the owner of the telnet > link no good at all. > > Tom Wyant > > > > This communication is for use by the intended recipient and contains > information that may be privileged, confidential or copyrighted under > applicable law. If you are not the intended recipient, you are hereby > formally notified that any use, copying or distribution of > this e-mail, > in whole or in part, is strictly prohibited. Please notify the sender > by return e-mail and delete this e-mail from your system. Unless > explicitly and conspicuously designated as "E-Contract Intended", > this e-mail does not constitute a contract offer, a contract > amendment, > or an acceptance of a contract offer. This e-mail does not constitute > a consent to the use of sender's contact information for direct > marketing > purposes or for transfers of data to third parties. > > Francais Deutsch Italiano Espanol Portuges Japanese > Chinese Korean > > http://www.DuPont.com/corp/email_disclaimer.html > > > ___ > 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 > ___ 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: Win32::OLE & MS Word
This will insert text at the beginning of a document. use strict; use warnings; use Win32::OLE; my $oWord = new Win32::OLE("Word.Application"); my $clBlue = 16711680; my $clGreen = 32768; my $oDoc = $oWord->Documents->Add(); $oWord->Selection->TypeParagraph; $oWord->Selection->Font->{Size} = 14; $oWord->Selection->Font->{Bold} = 998; $oWord->Selection->Font->{Name} = "Arial"; $oWord->Selection->Font->{Color} = $clGreen; $oWord->Selection->TypeText("Detailed Reports"); $oWord->Selection->TypeParagraph; $oWord->Selection->Font->{Size} = 10; $oWord->Selection->Font->{Bold} = 998; $oWord->Selection->Font->{Name} = "Arial"; $oWord->Selection->Font->{Color} = $clBlue; $oWord->Selection->TypeText("Detailed Reports2"); $oWord->Selection->TypeParagraph; $oDoc->SaveAs('c:\my.doc'); $oWord->Quit(); Nathaniel G. Bartusiak TTMS, Keesler AFB > Hi Toby > > I ran your program on my machine (Win2K pro) with Office 2k. > Unfortunately both words in the word doc were written in blue and not > one in green and on in blue as the program suggests they should be. > > I think the Range has be moved before the color is changed from green > to blue. BUT how? > > thanks > Syl > > ___ > 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: NET::Telnet
The Prompt is a regular expression that matches the commandline prompt from the remote shell. That means you'll want to match the prompt for the user you are logging in as. If I log into one of my remote windows machines through a telnet server and I see I have a prompt like so, "C:/" I'll need to match that within my code as prompt. If the prompt isn't matched in the time specified in Timeout then the script will either return false or die based on what Errmode is set to, return or die respectively. NET::Telnet Defaults: Timeout = 10 Host = "localhost" Errmode = "die" Prompt = "/[\$%#>]$/" # matches most unix shells. Port = 23 This is how you could establish a connection with a windows machine with NET::Telnet (Untested). use strict; my $TIMEOUT = 30; my $PROMPT = "C:/"; my $HOST = "foobar.foo.com"; my $USER = "Bob"; my $PASS = "password"; $telnet = Net::Telnet->new( Timeout => $TIMEOUT, Prompt => $PROMPT, Host=> $HOST, Errmode => "return"); $telnet->login($USER, $PASS); # Test here for success if using "return". my $msg = $telnet->errmsg(); if ($msg) { print "$msg\n"; $telnet->close; # do whatever you want here. } Hope this helps. Cheers, Carter. > -Original Message- > From: Jitendra Soam [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:39 AM > To: [EMAIL PROTECTED] > Subject: RE: NET::Telnet > > > > Thanks. > > But the what should be used as prompt? > > > > -Original Message- > From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 17, 2002 7:01 PM > To: [EMAIL PROTECTED] > Subject: Re: NET::Telnet > > > > "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > > > Is it possible to use Net::Telnet module to telnet into Windows > > machine running Microsoft Telnet Service.. > > In theory, yes, _provided_ the Telnet service is set up to do > username/password authentication. This is not the default. > > In practice, there appear to be significant problems figuring out what > you > should tell it the prompt string is, because Microsoft embeds > all sorts > of > escape sequences in it. > > > and start Any program like Notepad on target machine? > > In theory, yes. In practice, of course, Notepad displays on the target > machine's desktop, which probably does you as the owner of the telnet > link > no good at all. > > Tom Wyant > > > > This communication is for use by the intended recipient and contains > information that may be privileged, confidential or copyrighted under > applicable law. If you are not the intended recipient, you are hereby > formally notified that any use, copying or distribution of > this e-mail, > in whole or in part, is strictly prohibited. Please notify the sender > by return e-mail and delete this e-mail from your system. Unless > explicitly and conspicuously designated as "E-Contract Intended", > this e-mail does not constitute a contract offer, a contract > amendment, > or an acceptance of a contract offer. This e-mail does not constitute > a consent to the use of sender's contact information for direct > marketing > purposes or for transfers of data to third parties. > > Francais Deutsch Italiano Espanol Portuges Japanese > Chinese Korean > > http://www.DuPont.com/corp/email_disclaimer.html > > > ___ > 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 > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Using Pack and Unpack
Paul Flint <[EMAIL PROTECTED]> wrote: > I'm getting incorrect results from recipe 8.8 in the Perl Cookbook. > I'm building an index of offset positions for lines in a file (3 > MB), which I'm supposed to be able to use to access any line in that > file. > I use Code A to build the index. (taken from Perl Cookbook, see > below) > But when I use Code B (see below) to access it, I get back random > results if accessing lines higher than 90 or so. > I think that the offset value becomes too big to store in a > pack("N", $offset) and the index creator starts kicking out > random numbers, which of course cause line_with_index to read > random lines of the file. > Does this sound correct? And if so, what can I do about it? A > friendly pointer to the correct documentation would help. I > can't seem to find it in my Web searches. "N" packs or unpacks an unsigned long, which according to ANSI "C" goes to 4 gig; it's hard for me to believe you can overrun this in a 3mb file. What I think I would try instead is to put the index file into binary mode. right after you open it (hint: binmode I; ). What I fear is going on is that somewhere along the line you generate a byte whose value is 0x10. If that happens under Windows 32 and you're not in "binmode", the "C" runtime will "expand" this to 0x13 0x10, and at that point, you're dead in the water. So am I saying that Tom Christiansen and Nathan Torkington are wrong and I'm right? Not really. I don't own a copy of this book, but I suspect you'll find somewhere in the front matter something about the target system being some flavor of Unix. U**x doesn't need the "binmode", because the "C" RTL doesn't mung the I/O streams. On most other systems, though, it gets munged to make the data stream look a unix-y as possible to your code. Under Windows, this means translating 0x10 (= ) to 0x13 0x10 (= ) on output, and the reverse on input. Other things happen under other operating systems. If you look in the "perlport" documentation (a.k.a. "Writing Portable Perl") you will see: Because of the "text" mode translation, DOSish perls have limitations in using "seek" and "tell" on a file accessed in "text" mode. ... If you use "binmode" on a file, however, you can usually "seek" and "tell" with arbitrary values in safety. Tom Wyant This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portuges Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: NET::Telnet
Jitranda, I gave up trying to figure out what to use as a prompt for Net::Telnet when connecting to Windows' telnet server. Maybe someone out there will enlighten us both. Tom "Jitendra Soam" <[EMAIL PROTECTED]>@listserv.ActiveState.com on 09/17/2002 10:38:52 AM Sent by:[EMAIL PROTECTED] To:<[EMAIL PROTECTED]> cc: Subject:RE: NET::Telnet Thanks. But the what should be used as prompt? -Original Message- From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 7:01 PM To: [EMAIL PROTECTED] Subject: Re: NET::Telnet "Jitendra Soam" <[EMAIL PROTECTED]> wrote: > Is it possible to use Net::Telnet module to telnet into Windows > machine running Microsoft Telnet Service.. In theory, yes, _provided_ the Telnet service is set up to do username/password authentication. This is not the default. In practice, there appear to be significant problems figuring out what you should tell it the prompt string is, because Microsoft embeds all sorts of escape sequences in it. > and start Any program like Notepad on target machine? In theory, yes. In practice, of course, Notepad displays on the target machine's desktop, which probably does you as the owner of the telnet link no good at all. Tom Wyant This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portuges Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ 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 This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as "E-Contract Intended", this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portuges Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs