Re: Fixing a one-liner ("global" binmode?)

2007-09-17 Thread Bill Luebkert
Suresh Govindachar wrote: > > a) The stuff at the top is common to all perl scripts I write, and > it is too much trouble to tweak them on a per-script basis. > > b) The shebang line is when the script needs to be run on linux. That's pretty obvious. :) > c) The stderr to stdo

Re: Fixing a one-liner ("global" binmode?)

2007-09-17 Thread Bill Luebkert
Suresh Govindachar wrote: >Steve wrote as a deprecated top post: > > $Bill wrote: > >> Suresh Govindachar wrote: > >>> > >>> [almost working code] > >> > >> Try: > >> > $^I = '~'; no warnings 'once'; > >> while (<>) { binmode ARGVOUT if $. == 1; print; } > > > >The fol

Re: Fixing a one-liner ("global" binmode?)

2007-09-17 Thread Bill Luebkert
Suresh Govindachar wrote: > > The following worked -- didn't need to turn off warnings. Not sure why, I get a warning on using ARGVOUT only once. > #!/usr/bin/perl > BEGIN {(*STDERR = *STDOUT) || die;} Not sure why you want the above. > use diagnostics; > use warnings; >

Re: Fixing a one-liner ("global" binmode?)

2007-09-17 Thread Bill Luebkert
Suresh Govindachar wrote: > Hello, > > The following dos2unix one-liners > > perl -i~ -pe "s/\r\n$/\n/" > > fails in windows. I think it is because when > perl writes the resulting file, it re-inserts \r\n! > > The following code almost works: > > $^I = '~'; > my

Re: Big endian C to perl on x86 of binary file into structure

2007-09-16 Thread Bill Luebkert
arnings; > use strict; > $| = 1; > > my $file = 'foofile'; > >sysopen IN, $file, O_RDONLY or die "open $file: $! ($^E)"; # this is > line 10 > > __END__ > > Uncaught exception from user code:

Re: Big endian C to perl on x86 of binary file into structure

2007-09-15 Thread Bill Luebkert
Suresh Govindachar wrote: > Hello, > > The following code is meant for a Big-endian processor running > linux. The code reads binary files and assigns values to > structures. I would like to read the same data files in perl on > Windows on little endian x86. Any tips on doing the transl

Re: tk stay on top problem with perlapp for win32

2007-09-06 Thread Bill Luebkert
Spencer Chase wrote: > Greetings perl-win32-users, > > Providing a script the demonstrates the problem as per $Bill's > suggestion. The script runs fine but fails with the above listed error > message when I try to make an exe with parlapp. Here is the script. > The error messages and portion of s

Re: stayOnTop?????????

2007-09-05 Thread Bill Luebkert
Spencer Chase wrote: > Greetings perl-win32-users, > > Not sure what group to post this to so I am trying this one first. > > I have a perl TK script that uses StayOnTop. It works fine when I run > it from Komodo but when I try to make an exe with PerlApp, it does not > work. I have installed Sta

Re: Error message not showing up from Net::SMTP

2007-09-05 Thread Bill Luebkert
Sisyphus wrote: > - Original Message - > From: "Suresh Govindachar" <[EMAIL PROTECTED]> > . > . > >> sub auth { >> my (\$self, \$username, \$password) = [EMAIL PROTECTED]; >> >> eval { >> require MIME::Base64; >> require Authen::SASL; >> } or \$self->set_status(500, ["Need M

Re: Any hint when 5.10 will be out?

2007-09-05 Thread Bill Luebkert
Foo JH wrote: > Something interesting to look forward to: > > 'print' will be replaced by 'say' > > Major change, I'll say! I seriously doubt that's true - maybe augmented, but not replaced. Replacing print would break to many scripts/modules. > 田口 浩 wrote: > >>New month, >> >>And I hope "File

Re: win32::daemon & Pod::Webserver ???

2007-08-30 Thread Bill Luebkert
Michael D Schleif wrote: > I installed Pod::Webserver & executing podwebserver from CLI works OK; > except that it requires keeping open a Command Prompt window. > > So, I thought that I could use Win32::Daemon to create and run it as a > service ;> > > The service installs successfully. > > How

Re: How do I read the Response Headers form URL post?

2007-08-24 Thread Bill Luebkert
Mark Funk wrote: > > Folks, > > How do I read the response header information. > > I am using LWP gets ... > my $response = $ua->get("$baseurl/$home"); > $home_page = $response->as_string; > > How would I code to read the Response headers? Something like this should work: print "Headers

Re: finding the window

2007-08-09 Thread Bill Luebkert
Daniel Burgaud wrote: > Hi > > Is there a way for Perl (GUITest or other modules for that matter) to > know that > a window is owned by a particular program? GetWindowThreadProcessId might help you. > Currently, I am using Win32::GUItest > > > my @windows = FindWindowLike(0, program name, und

Re: Changing Group ID

2007-08-02 Thread Bill Luebkert
HOPE Bill wrote: > Hi, > I'm either not understanding (probable) or I cannot find how to change > the group membership of the current executable such that files created > by the process have the group ownership I need. > > setpgrp() doesn't seem to be it. > > Ideally, it would work on Windows

Re: Add password & generate ZIP file

2007-07-02 Thread Bill Luebkert
田口 浩 wrote: > Hello, > > Anyone has a guide to add password & generate ZIP file with Perl? > "Archive::Zip" doesn't support password, does it? > > I have over 1,000 file as a plain text files. And I must add each > password and convert into ZIP files. > The password is calculated from each file n

Re: Perl-Win32-Users Digest, Vol 11, Issue 15

2007-07-01 Thread Bill Luebkert
Ozette Brown wrote: > All, > > To remove CRTL-M's try this: > > perl -pi -e 's/\cM$//g' file.pl > > And, it's done. 1) You could have stripped most of that digest and put your reply after whatever portion you were responding to rather than top-posting. 2) If you had tested the above cmd, you w

Re: Changing space to escaped space

2007-06-19 Thread Bill Luebkert
John Townsend wrote: > I’m trying to change a space to an escaped space. > > I've tried something like this: > > $string = "._\\agmptestapp.exe_ -i > ._\\performance_in\\3Pages3Squares.pdf_ > -o ._\\performance_out\\_ > -1 -dic never -t ps3 -s irs -ppd AdobePDF > 8.0 -timer > timer.txt"; >

Re: Command line switches aren't recognized

2007-06-15 Thread Bill Luebkert
DC Brian wrote: > Hi. First of all, I am a total newbie to Perl, so forgive my ignorance. > I am using someone else's script here; let's call it foo.pl. > > Without going into too much detail about the code or whether it works > correctly, let's just say that we have two near identical WinXP PC

Re: perltidy and new line before comment

2007-06-11 Thread Bill Luebkert
田口 浩 wrote: >>Try: perltidy -l=200 -i=2 -pt=2 -ce -st -nbbc T1.pl > > > Thanks, it's what I'm loooking for, "No BBC"! -:) > > perltidy help is somewhat difficult to understand for > non English speaker, isn't it? I didn't read the help. It says it should be here: http://perltidy.sourc

Re: perltidy and new line before comment

2007-06-11 Thread Bill Luebkert
田口 浩 wrote: > Hello, > > I can't learn much from perltidy help page. > One is I don't like new line before such a comment, > "# call some sub". > Someone would show me the correct switch? > ... > C:>perltidy -l=200 -i=2 -pt=2 -ce -st T1.pl Try: perltidy -l=200 -i=2 -pt=2 -ce -st -nbbc T1.pl

Re: Win32-API aborting mid-application

2007-05-30 Thread Bill Luebkert
thinking right or replace the C180 with a list of each field in the structure's actual type: my ($dmDeviceName, $dmSpecVersion, $dmDriverVersion, $dmSize, $dmDriverExtra, $dmFields, ...) = unpack 'C32S4I...', unpack ('P', $mode);; I've never dealt

Re: Win32-API aborting mid-application

2007-05-29 Thread Bill Luebkert
Adam R. Frielink wrote: > I have hit a road block using the Win32-API module. I've gotten a > working tool which allows me to modify the contents of the Crystal > Reports RPT file in memory using the API interface. Unfortunately, > everytime I attempt to access a particular method, my application

Re: Problem with Win32::GetOSVersion()

2007-05-23 Thread Bill Luebkert
Jan Dubois wrote: > > You are printing the PRODUCTTYPE value instead of the ID. Use $s[4] instead > of $s[-1]. Also note, if you're running in XP compatibility mode, you'll get 5 instead of 6 for major. ___ Perl-Win32-Users mailing list Perl-Win32-User

Re: GoldMine DLL access

2007-05-21 Thread Bill Luebkert
Sisyphus wrote: > > On the other side of the ledger, I think that Win32::API still requires that > the dll has been built using __stdcall calling convention, whereas that's > not a requirement with Inline::C/Inline::CPP. (Perhaps things have changed > on that score. I think there's a version of

Re: GoldMine DLL access

2007-05-21 Thread Bill Luebkert
Sisyphus wrote: > - Original Message - > From: "Paul Rogers" <[EMAIL PROTECTED]> > . > . > >>While I've worked plenty in perl I've never had to connect to/use a DLL. >>GoldMine's API uses a DLL. While of course they have plenty of docs for >>VB >>and C++, they have none for perl. >> > >

Re: Perl to move mouse and click

2007-05-19 Thread Bill Luebkert
Daniel Burgaud wrote: > Hi, > > I want Perl to move the mouse cursor to a particular X,Y coordinate, and > then Left Click. > > How is this done? Try: use Win32::GUITest; ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To

Re: How do I know where my Perl script is running?

2007-05-15 Thread Bill Luebkert
Sisyphus wrote: > - Original Message - > From: "Wagner, David --- Senior Programmer Analyst --- WGO" > <[EMAIL PROTECTED]> > > $0 holds the name of the file executing your script. It appears as > fully qualified name. No it doesn't. It may or may not be fully qualified. > I don'

Re: Perl Report Format Question

2007-05-08 Thread Bill Luebkert
Dax Games wrote: > Why don't I Get IP addresses in the IP Address column of the report > below. The data is there if I do a print after the split of the value > in %GAA_Up. I get: PS: I see no need for using format for this report - (s)printf should suffice. Always supply a runnable test case

Re: DBM file handles & "close-on-exec" ?

2007-05-07 Thread Bill Luebkert
[EMAIL PROTECTED] wrote: > Hi! > > I have a Perl script that opens a number of DBM files. It also starts > other programs via calls to "system". I recently found out that the > "handles" to the DBM-files seem to be inherited by the newly started > process. I would like to avoid this. Does anybody

Re: Alert if box not checked

2007-04-18 Thread Bill Luebkert
Jerry Kassebaum wrote: > Friends. > > I want to pop up an alert if a checkbox isn't checked. > > Below is the code I have so far. > > Notes: > 1. The cgi page is actuatlly at > http://www.biblescramble.com/Esther/scriptCheck.cgi > 2. x.cgi doesn't exist. This doesn't get that far. I'm just work

Re: Need OLE COM/Variant help

2007-04-12 Thread Bill Luebkert
[EMAIL PROTECTED] wrote: > Hi List, > > I am using Win32::OLE to access a custom COM interface > (Secure FTP Server by GlobalSCAPE). Mostly I have been successful > after much reading, experimentation and gnashing of teeth but > how to retrieve a VARIANT array totally escapes me. The only interfac

Re: filefield...Solution number 7: UPDATE

2007-04-12 Thread Bill Luebkert
Jerry Kassebaum wrote: > I wrote back to the guys at my server, asking what they did to solve the > problem. The actual solution was that they added this line, right under the > shebang line: > > $CGITempFile::TMPDIRECTORY = '/users/web/kass/web/dns/tmp'; You could also have just done a mkdir '

Re: filefield

2007-04-12 Thread Bill Luebkert
Jerry Kassebaum wrote: > > I tried > > my $tmpdir = "/tmp"; > > and > > my $tmpdir = $ENV{TEMP} || "C:/tmp"; > > and > > my $tmpdir = $ENV{TEMP} || "/tmp"; > > Same error: "Software error: > > CGI open of tmpfile: Permission denied" Things to look at or try: 1) What are the perms on /tmp

Re: filefield

2007-04-11 Thread Bill Luebkert
Jerry Kassebaum wrote: > Bill et. al., > > This is a little embarrasing. Bill, you helped me with a similar problem > back in December, but I never quite got it. Below is the code you gave me. > But when I browse to a file and submit, I get the error: "Software error: > CGI open of tmpfile: Per

Re: filefield

2007-04-11 Thread Bill Luebkert
Jerry Kassebaum wrote: > Friends, > > I'm hoping I'm missing something obvious. > > I have a cgi page with checkboxes, radio buttons, textareas working. > However, I'm trying to add a filefield and having trouble. > > I have a print statement, followed by a few lines ending in commas. > > Late

Re: Redirecting STDOUT

2007-04-02 Thread Bill Luebkert
Chris Rodriguez wrote: > > Hi. "cmd" refers to any command, right? Neither formulation works for > me. If I do: > $output = `perl -c somescript.pl`; > I see "somescript.pl syntax OK" on the screen, and the variable $output > remains unassigned. If I do: > $output = `perl -c somescript.pl 2>&

Re: Redirecting STDOUT

2007-03-30 Thread Bill Luebkert
Chris Rodriguez wrote: > Hi everyone, > I saw the following on another PERL list-serve: > > "If you are on windows, then see perlfaq8 if ActiveState perl for > how to redirect STDOUT and STDERR when doing backticks." > > I'd like to be able to capture STDOUT as a string. But nothing on perlfaq8

Re: Socket programming / Network connectivity ?

2007-03-28 Thread Bill Luebkert
Theisen, Gary wrote: > Hi all, > > I'm obviously new to socket programming, so please bear with me. > > Generically, I've got a situation where I would like to write a PERL > script to check 'network connectivity' between two machines. > > A bit more specifically, I need to check the network

Re: subs, eval, and BEGIN

2007-03-18 Thread Bill Luebkert
Glenn Linderman wrote: > > Well, nice you got rid of the BEGIN block... and it compiles and > produces the right output twice oops. I sure can't see where it > does that! One print statement, in a sub that is called once! Show your new code. > The ; can alternately go after END_OF_SU

Re: subs, eval, and BEGIN

2007-03-18 Thread Bill Luebkert
Glenn Linderman wrote: > So I'm trying to make a sub to tr iso-8859-1 to unaccented ASCII > equivalents. Maybe one already exists, somewhere, but now that I've > gotten this far, I'm confused: > > #!perl Where's your use strict and use warnings ? > BEGIN { > my ( $tfrom, $tto ); > $tfrom

Re: how to round a floating-point value to an integer value

2007-03-16 Thread Bill Luebkert
Casteele/ShadowLord wrote: > > Actually, Bill's answer has an error.. Adding .05 just introduces a subtle > error because some > decimal floating point numbers cannot be exactly represented in binary form. > For example: > > my ($i, $j); > foreach $i (0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8

Re: how to round a floating-point value to an integer value

2007-03-16 Thread Bill Luebkert
Su, Yu (Eugene) wrote: > Interesting. Any explanation why sprintf treats 3.5 and 4.5 differently in > rounding? Try adding this to the loop: printf "%.20f", $_; ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To uns

Re: how to round a floating-point value to an integer value

2007-03-16 Thread Bill Luebkert
Su, Yu (Eugene) wrote: > I expect > print sprintf("%.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f", 0.5, 1.5, > 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5); > will give me > 1 2 3 4 5 6 7 8 9 10 > but instead I get > 0 2 2 4 4 6 6 8 8 10 > > How to round a floating-point value to an integer val

Re: Hitting a line limit while reading a file

2007-03-14 Thread Bill Luebkert
Ken Cornetet wrote: > That character would be a ^Z, which is an end-of-file indicator for > microsoft. > > I can already hear people asking "Why the need for an EOF character when > MS file systems record an exact byte count?" Ok, maybe it's just the > usual voices in my head that I hear, but for

Re: Hitting a line limit while reading a file

2007-03-13 Thread Bill Luebkert
Howard Maher wrote: > I was simply counting the number of lines in a 2 gig file, printing to STDERR > every 10,000 lines to indicate the program was making progress, but the > program stopped at 12,960,000 lines read... an hour and a half later it still > hadn't budged... > What kind of memory

Re: localtime failing on DST change

2007-03-13 Thread Bill Luebkert
Dial, Joe wrote: > > Hello $Bill, > I love reading your answers to other people's problems. I hope I can > help you. > Microsoft announced that there is a patch to the MSVCRT.DLL which may be > used by the perl executable. > I don't know the windows equivalent to ldd to be sure MSVCRT.DLL is use

localtime failing on DST change

2007-03-13 Thread Bill Luebkert
My 'localtime' function output doesn't reflect DST since the Sunday changeover. System: XP Pro; Perl B811 The earlier DST change time seems to be picked up OK by Windoze clock. There was some mention of the table changes by Microsoft I believe and there is some info at http://support.microsoft.c

Re: STDIN not available/@ARGV empty

2007-03-09 Thread Bill Luebkert
Jan Dubois wrote: > For example: > > ASSOC .pl=PerlScript > FTYPE PerlScript=perl.exe %1 %* > > would allow you to invoke a Perl script as follows: > > script.pl 1 2 3 > > If you want to eliminate the need to type the extensions, then do the > following: > > set

Re: STDIN not available/@ARGV empty

2007-03-08 Thread Bill Luebkert
Nelson R. Pardee wrote: > Bill, > > Thank you! > > When I use "perl pgmname" all works as advertised! I can see the command > line arguments and STDIN. So that gives me a workaround, although it > really is convenient not to have to know the path to the program (and may Path to what program ? I

Re: STDIN not available/@ARGV empty

2007-03-07 Thread Bill Luebkert
Nelson R. Pardee wrote: > 1. I want to pipe the output from a program to STDIN such as >type somefile|myperlprogram.pl I've done this forever in unix, but in > Windows/dos it behaves weirdly. -t STDIN doesn't know that it isn't > pointing at the tty (terminal), yet the script doesn't try to rea

Re: checking for infinite loops

2007-03-05 Thread Bill Luebkert
Chris Wagner wrote: > At 04:01 PM 3/4/2007 -0800, Bill Luebkert wrote: > >>What's the exact message ? I added $^E in code below which may help. > > > Using this format to get the most recent Windows error message is good for > clarity's sake. $^E is co

Re: checking for infinite loops

2007-03-04 Thread Bill Luebkert
Chris Rodriguez wrote: > > Hi all, > Thanks very much to everyone for this list-serve, and especially to Rob > and Bill for helping me so much with this. I'm basically using Bill's > code (below) and I have it doing what I want. So yay, mission > accomplished, basically, but two peculiar glit

Re: Cookie Trouble, Honed In

2007-02-22 Thread Bill Luebkert
Jerry Kassebaum wrote: > The following cgi script is at http://biblescramble.com/ezo7x.cgi. > > The first time you load this page it will set a cookie on your machine and > display the error message in the last line of the script. > > The next time(s) you load it it will redirect to the html pag

Re: Cookie Trouble

2007-02-21 Thread Bill Luebkert
Jerry Kassebaum wrote: > > I'll work on that if I need to. But while I'm working, any clue why > > print "Location: http://biblescramble.com/biblescramble7.html\n\n";; > > would PRINT the location to a new page if a new cookie is set, and GOTO > the location if the cookie has already been set??

Re: Cookie Trouble

2007-02-20 Thread Bill Luebkert
Jerry Kassebaum wrote: > > If you need more details, let me know. If you go to biblescramble.com an > play the first game you'll see what I mean. Try twice and the game will > work. Delete my cookie from your machine and it will goof up again. 1) Create a new script that has only the code neede

Re: Name of IF style

2007-02-04 Thread Bill Luebkert
Foo JH wrote: > Taguchi san, > > I like the coding style below for one main reason: it's easy to comment > out if needed. No easier than any other method - other than it's compressed into fewer lines - which also makes it less easily modified. > IMHO good coding style should support the followi

Re: Name of IF style

2007-02-03 Thread Bill Luebkert
田口 浩 wrote: > Hello, > > The code below is in the Camel book, and I like this style. > Anyone knows the name of this style or there is no such a name? > > > if(/^abc/) { $abc = 1 } > elsif (/^def/) { $def = 1 } > elsif (/^xyz/) { $xyz = 1 } > else { $not

Re: checking for infinite loops

2007-01-28 Thread Bill Luebkert
Chris Rodriguez wrote: > > If the alarm function now works on Windows, why doesn't this code give > me the results I expect? Might it matter than I'm using Windows ME? > What about my version of PERL? It's the one from the CD that came with > that book. 5.6 I think - I can check if it matte

Re: libwin32-0.26 installation problem on linux

2007-01-25 Thread Bill Luebkert
Jeff Griffiths wrote: > Hi Sasan, > > You're getting these errors because libWin32 is not compatible with > Linux. It only works on Windows systems. Maybe it will run under a Windoze emulator ? Sasan porbably ought to stick to PPM installs rather than trying to install from CPAN/wherever. _

Re: problem with write fucntion in Spreadsheet::WriteExcel

2007-01-25 Thread Bill Luebkert
raj esh wrote: > Dear Gurus, > > I want to write some data into the Excel sheet. I have written code > can you people guide me where i am going wrong! > > All code is working fine but data is not getting written in the result.xls > > Here is the code.. > > =

Re: Help with CGI and CGI::Cookie

2006-12-26 Thread $Bill Luebkert
Casteele/ShadowLord wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I don't know perl well enough to figure this out, but there's prolly a super > simple answer.. I've got a perl CGI script using CGI.pm: > > [code] > use CGI; > > my $q, $c; > > $q = new CGI; > $c{'old'}

Re: Problem with Win32::Perfmon API

2006-12-14 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > > Hi, > > I had tried doing it but the ppm is giving up !! > > It gives an error of "Cannot connect to the host www.bribes.org < Bad > host name>" It worked ok for me. http://www.bribes.org/perl/ppm/ ___ Perl-Win32-Use

Re: Problem with Win32::Perfmon API

2006-12-13 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > > Hi, > I had been trying to install win32::Perfmon API . hile installation it > is giving warning of some libraries from lib/CORE missing (eg > PDH.lib,msr.lib .) . but makes the Makefile on proceeding > for making the binaries from it, it gives an error th

Re: Portable version of Perl for Windows

2006-12-09 Thread $Bill Luebkert
Vladimir Zelinski wrote: > Dear colleagues. > > Probably, question I would like to ask is not a new > one, but my search on Internet didn't bring any > meaningful result. > I would like to have a portable version of PERL on my > USB drive. I want to be able to run programs > on a Windows machine

Re: Counting Matches In A Line

2006-12-05 Thread $Bill Luebkert
Chris Wagner wrote: > At 02:39 PM 12/5/2006 -0500, Joe Discenza wrote: > >>The tr/// operator counts all the occurrences of the translated >>character(s) in $_ (the default), and then you just increment the @semis >>array at the index of the number of semicolons found to indicate another >>line w

Re: File Upload

2006-12-03 Thread $Bill Luebkert
Jerry Kassebaum wrote: > Friends, > > The cgi below is at http://biblescramble.com/dns/textArea04.cgi. > > If you type lines in the text box, it spits them back when you hit "Submit > Query". > > However, I also want it to spit back a text file. What am I missing? If you want to spit back a t

Re: readdir problem

2006-11-29 Thread $Bill Luebkert
$Bill Luebkert wrote: > Dan Jablonsky wrote: > > >>Hi all, >>I am trying to read only files in a directory; I need >>to jump over the dot files and any subdirectories. >>Seems like a simple thing, however with >> >>opendir(DIR, $dir) || die "ca

Re: readdir problem

2006-11-29 Thread $Bill Luebkert
Dan Jablonsky wrote: > Hi all, > I am trying to read only files in a directory; I need > to jump over the dot files and any subdirectories. > Seems like a simple thing, however with > > opendir(DIR, $dir) || die "can't opendir $dir: $!"; > foreach my $file (readdir DIR) > { > next if (/^\./)

Re: Win32 and alarm

2006-11-28 Thread $Bill Luebkert
Sisyphus wrote: > I don't think ActiveState *can* implement wait() to handle processes > launched with backticks. But they already provide you with the > Win32::Process module, which is the correct course of action ot take. > > If I understand you correctly, you can just use Win32::Process's Wait

Re: Win32 and alarm

2006-11-28 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: >>`` is blocking, so maybe use Win32::Process and time it with >>Time::HiRes. You may need to redirect the output to a file. > > > sounds a heavy task. > Any possibility to wait for ActiveState implementing it? They sorta have, but since the OS doesn't support it, it's

Re: Win32 and alarm

2006-11-28 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Hello, > > I hear that Win32 cann't use "alarm" for a timeout. > The sample code in Camel book or Cookbook is not valid > on Win32. Is this true even now? > > I must execute some external command by @rc = `SOME.exe`, > which may hung sometimes. > These are SQLPLUS and F

Re: Scripts just stopped working..

2006-11-28 Thread $Bill Luebkert
Mark Funk wrote: > Folks, > > I wrote some Perl scripts that connects to an HTTP server and determines the > availability of a web page.. > This has been working fine for about six months. All of the sudden the script > stopped working and I made NO change. > > Script snippet: ... > @step1 = $

Re: POST request using LWP help with php forms

2006-11-16 Thread $Bill Luebkert
Alejandro Santillan Iturres wrote: > I need to download a page which is password-protected (php): > http://marketsmart-real.pcquote.com/login.php?redirectLocation=getquote.php?symbol=NDX > > When accessing the former page, it is requested a user and password via > a form. > Used AJS2 and passwor

Re: Extremely fast concat required

2006-11-11 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > hello all > > I need a fast concat solution. the following works, but it is extremely slow > and > it stutters. I am not replicating values, each value that is concatonated is > unique- the following is example does not illustrate this. > > about the stuttering...is t

Re: help with sockets

2006-11-07 Thread $Bill Luebkert
Alejandro Santillan wrote: > The $i reaches the number 57, before hanging. It seems that well before > reaching > the !END! string it reads some char undef or something. You need to check $bytes for error and EOF before reading again. >>>whereas: >>> >>> >my $buffer; >my $bytes = sysread

Re: help with sockets

2006-11-07 Thread $Bill Luebkert
Alejandro Santillan wrote: >>Alejandro Santillan wrote: >> >> >>>Bill, I was using your solution successfully to read several messages > > sent > >>>by the server, but when trying to work some request, >>>which had a longer answer, your buffer only gets: >> >>... >> >>>How could I modify your ro

Re: Expanding environment variables

2006-11-03 Thread $Bill Luebkert
Wong, Danny H. wrote: > Hi Perl GURU's, > In my Perl script, I read a text file and parse each line > delimited by the first "=" character and create environment variables > for each line of data. My question is: is there a way to expand the > environment variable when trying to assign an en

Re: Expanding environment variables

2006-11-03 Thread $Bill Luebkert
Wong, Danny H. wrote: > Hi Perl GURU's, > In my Perl script, I read a text file and parse each line > delimited by the first "=" character and create environment variables > for each line of data. My question is: is there a way to expand the > environment variable when trying to assign an en

Re: Newbie: email from perl script

2006-11-03 Thread $Bill Luebkert
khozaima shakir wrote: > Hi All, > I am a newbie to perl. Have installed active state and installed libnet > module. > > Am trying to learn how to send email from perl script and get follwing > error : > > Can't call method "mail" on an undefined value at myfirst.pl line 152, > line 1. Which l

Re: help with sockets

2006-11-01 Thread $Bill Luebkert
Alejandro Santillan wrote: > Bill, I was using your solution successfully to read several messages sent > by the server, but when trying to work some request, > which had a longer answer, your buffer only gets: ... > How could I modify your routine, which is the following: > > my $buffer; > my $b

Re: time manipulation

2006-10-27 Thread $Bill Luebkert
Alejandro Santillan wrote: > I would like to know if there exists some module that is able con add and > substract times. > > For example, I want to see the time in seconds between the beginning and > ending of an application. > Something like this: > > $a="13:12:01"; > $b="13:02:01"; > > $c=$a

Re: sharing access to a socket

2006-10-27 Thread $Bill Luebkert
Daniel McBrearty wrote: > thanks Bill. but why is it so inadvisable? I don't get it. I'd have > thought that some app where you want one task to execute periodically > while another responds to user input was exactly where you should use > threads. (I'll look into your suggestions though.) I agre

Re: sharing access to a socket

2006-10-27 Thread $Bill Luebkert
Daniel McBrearty wrote: > Now I want to run a thread inside this app that sends back info > regularly. It needs to run in a seperate thread, and be startable and > stoppable, which I have working. I don't care if the responses from > the main thread and the reporter thread lines are mixed up ... i

Re: Time::HiRes inaccurate on win?

2006-10-26 Thread $Bill Luebkert
Daniel McBrearty wrote: > I wrote a script today that started a thread that was polling every > 1000ms. I used > > use Time::HiRes qw( usleep ); > usleep(1000 * 1000); > > I didn't get the stopwatch out, but it looked as if the timing was way > off. As I need to scale to much shorter timings, I

Re: help with sockets

2006-10-26 Thread $Bill Luebkert
Alejandro Santillan wrote: > The output was: > 8=FIX.4.0.C35=A52=10/26/2006 8:16:10 AM100=PFG10=999 > What is simply correct, but if I put 58 instead of 57, the program hangs > indefinitely. > Obviously I don't know the lengh fo the message beforehand. > > Anyone has any idea why this happens and

Re: Evaluating inside a here document

2006-10-22 Thread $Bill Luebkert
Suresh Govindachar wrote: > $Bill Luebkert wrote: > > Suresh Govindachar wrote: > > > >> Thanks for @{[]} -- it is better than evaluating outside the > >> here doc. This is because the expressions I need to evaluate > >> are fairly co

Re: Evaluating inside a here document

2006-10-22 Thread $Bill Luebkert
Suresh Govindachar wrote: > But what does "use a simple vrbl" mean? You mean a verbal > description? vrbl => variable > Thanks for @{[]} -- it is better than evaluating outside the > here doc. This is because the expressions I need to evaluate > are fairly complex and the variabl

Re: Evaluating inside a here document

2006-10-21 Thread $Bill Luebkert
Suresh Govindachar wrote: > Hello, > > |use warnings; > |use strict; > | > |# Question: In the following, any suggestions for ensuring > |#that $stuff will be " Twice 3 is 6"? > |# > |#For example, if the here-document were re-written > |#to

Re: what?!? [OT]

2006-10-19 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > > My favorite quote anent this somewhat off-topic topic is from a 1949 > Popular Mechanics magazine: > > "Computers in the future may weigh no more than 1.5 tons." I worked on some of those. > Hee, hee, giggle, chortle, chuckle > > From the one-time owner of a T

Re: what?!? [OT]

2006-10-19 Thread $Bill Luebkert
George Gallen wrote: > Wasn't this already done.with Robin Williams (he was a "cutter"), > where they would > put all the "good" things about your life in a video on your grave. > Forget the name of the movie. The Final Cut. Ah yes, very similar idea, but we don't cut the bad stuff.

Re: what?!? [OT]

2006-10-19 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > >>Every minute of your life will >>be permanently recorded for prosperity on 100 ZB (zetta-byte) >>or 10 YB (yotta-byte) memory cells > > Er, $Bill, did you mean "recorded for posterity", by any chance? Both probably - especially if you're in the Spielberg class - may

Re: what?!? [OT]

2006-10-18 Thread $Bill Luebkert
Sisyphus wrote: > - Original Message - > From: "$Bill Luebkert" <[EMAIL PROTECTED]> > >>Every minute of your life will >>be permanently recorded for prosperity on 100 ZB (zetta-byte) >>or 10 YB (yotta-byte) memory cells implanted under your

Re: what?!? [OT]

2006-10-18 Thread $Bill Luebkert
Sisyphus wrote: > In 2038 I'll be 86. I don't take it for granted that I'll be seeing anything > at all :-) I'll save you a spot in my old folks home. :) Not to mention in addition to the 32-bit computers all being in a dump somewhere, so will the 64-biters and the 128-biters. They'll probably

Re: Parallel Port module

2006-10-18 Thread $Bill Luebkert
Sisyphus wrote: > > From: "Spencer Chase" <[EMAIL PROTECTED]> > >>Greetings perl-win32-users, >> >>I am hoping to use the parallelport drv module by Scott Penrose which >>is available from CPAN. I want to use it on windows and it seems to >>require a separate win32 module. > > Which module ? Th

Re: what?!?

2006-10-17 Thread $Bill Luebkert
John Deighan wrote: > Trust me - all code has bugs in it. That's not true. If you slap a million lines together, then you have a better chance, but a good programmer in a proper environment doesn't write buggy code (or at least removes the bugs before going into production). You'd never get a

Re: what?!?

2006-10-17 Thread $Bill Luebkert
John Deighan wrote: > > The problem comes when you have a function that computes an index, > it's buggy and returns a negative number. The point is to debug your code properly. You can't expect buggy code to work properly anywhere. This is just one spot where a bug in your code could cause yo

Re: Generate RFC-2821 compliant date ???

2006-10-12 Thread $Bill Luebkert
Michael D Schleif wrote: > Consider this code: > > use POSIX qw(strftime); > print strftime("%a, %d %b %Y %H:%M:%S %z", localtime 1160662136), "\n"; > > On *NIX, that code produces this output: > > Thu, 12 Oct 2006 09:08:56 -0500 > > On Windows, using ActivePerl, I get this output

Re: Problem loading Archive::Tar

2006-10-10 Thread $Bill Luebkert
Sisyphus wrote: > I get the feeling that if I can get Config_heavy.pl's launcher() subroutine > to load, then my problem will go away. But I haven't yet worked out what > could possibly be preventing it from being run. Give it up and re-install. :) __

Re: Win32::FileOp Question, and Odd Error behavior

2006-10-04 Thread $Bill Luebkert
Dennis Daupert wrote: > Ah, OK, thanks for that info. So 1 or 0 does not mean > 'success' or 'failure,' but rather number of copies. You should never get a 0 - just >0 or undef. No need to CC me - I get 3 copies. I CC you so you get an immediate reply (as the poster) esp. when AS is slow during

Re: Win32::FileOp Question, and Odd Error behavior

2006-10-04 Thread $Bill Luebkert
Dennis Daupert wrote: > Still having the same error capture problems tho. > When I un-share the remote directory, run the > script, here's what get's written to my log (I'm > particularly unnerved by the msg "The operation > completed successfully"): > > [2006-10-04 04:53:08] Try to copy file tes

  1   2   3   4   5   6   7   8   9   10   >