Re: File Handle Pipes

2006-04-05 Thread David Wheeler
On Apr 4, 2006, at 21:41, $Bill Luebkert wrote: Have you tried something like my $process = '/path/to/process'; open IN, $process | or die open $process |: $! ($^E); while (IN) { print; } close IN; Ah, no, I haven't. I was trying to avoid shell interpolation. But you're right, it

Win32::Console::ANSI

2006-04-05 Thread Roger Mayfield
I have a script that connects to IRC, it outputs to the STDIN messages heard in the chatroom. Whenever someone writes in color, it shows a heart followed by 03. Now I know to display color in IRC you use the escape code \003. My question is how would I transpose the IRC escape sequence into a

Re: Win32::Console::ANSI

2006-04-05 Thread $Bill Luebkert
Roger Mayfield wrote: I have a script that connects to IRC, it outputs to the STDIN messages heard in the chatroom. Whenever someone writes in color, it shows a heart followed by 03. Now I know to display color in IRC you use the escape code \003. My question is how would I transpose

Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Yekhande, Seema \(MLITS\)
Title: Want to reduce the speed of execution in Perl script. Dear All, Suppose I have a log length tab-separated file, in this file I have to make the average of numbers based on certain parameters as hour, group name and monitor name. This program takes long time in running. my

RE: Win32::Console::ANSI

2006-04-05 Thread Jerry Kassebaum
Roger, I don't know what the answer is, but I'll bet it's no coincidence that chr(3) is ansii for the heart symbol. print chr(3); # This prints the character for a heart from a Windows file: ; # Make it so the DOS window doesn't disappear before you hit return Show me a

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Peter Eisengrein
system(qq~agrep $fir\t$sec\t $outfile tmp~); ## agrep is an external utility to find search pattern in a file and transfer it into other file. system(qq~agrep $thr tmp tmp1~); ## agrep is more faster than regular expression. Are two system calls to agrep really faster than a single,

RE: Finding duplicate string in a set of files and sections

2006-04-05 Thread Peter Eisengrein
I have this program below that work correcly but the performance is slow if the files are big. How can I write a program to do this instead the one I wrote. Without getting into too much detail there are several things that can help, all are related to the overall architecture of the code.

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Yekhande, Seema \(MLITS\)
Actually Regex is taking more time instead of agrep. That's why the idea of using either agrep or find. This is small input.txt which I am using it as a input file. If there is any other way of increasing the speed of same Perl script, it is really required. Thanks, Seema. -Original

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Nelson R. Pardee
On Wed, 5 Apr 2006, Yekhande, Seema (MLITS) wrote: Actually Regex is taking more time instead of agrep. That's why the idea of using either agrep or find. What's the difference? Several times? Twice? A bit? I haven't been paying attention, so pardon if I missed something. For each invocation

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Thomas, Mark - BLS CTR
Actually Regex is taking more time instead of agrep. That's why the idea of using either agrep or find. This is small input.txt which I am using it as a input file. If there is any other way of increasing the speed of same Perl script, it is really required. This has a chance of being

RE: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Peter Eisengrein
Actually Regex is taking more time instead of agrep. That's why the idea of using either agrep or find. This is small input.txt which I am using it as a input file. If there is any other way of increasing the speed of same Perl script, it is really required. I don't have agrep but since

Re: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Lyle Kopnicky
Yekhande, Seema (MLITS) wrote: Does anyone is having different idea about reducing the speed in execution? This I am finding out about how to reduce the speed. You can reduce the speed by: 1) running on a slower machine, 2) running other compute-intensive programs at the same time, or 3)

Efficiency

2006-04-05 Thread Ng, Bill
Since Efficiency seems to be the topic of the day, My situation, I have an array filled with 8-character strings, a few thousand of them. First 4 chars are letters, last 4 are numbers. Examples - abcd1234, zyxw9876, etcc. The letters portion is a prefix, the numbers is a version.

Name and Password from LWP

2006-04-05 Thread Jerry Kassebaum
Friends, I would like to learn how to enter a name and password with Perl, using LWP. I'm sure this exercise will be instructive for others looking in, also. I have set up an e-mail account for this purpose. The address is [EMAIL PROTECTED] and the password is perl. Use it as you see fit.

RE: Efficiency

2006-04-05 Thread Ng, Bill
Okay, Here's what I've come up with: -- @list = (aacs1110, brbt4332, rtxa4320, aacs2000, brig5621, brbt5220, nbvc); @list = sort @list; foreach $item (@list) { $itemPref = substr($item, 0, 4); $itemVers = substr($item, 4); $h{$itemPref} = $itemVers; } foreach $pref

RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: Since Efficiency seems to be the topic of the day, My situation, I have an array filled with 8-character strings, a few thousand of them. First 4 chars are letters, last 4 are numbers. Examples - abcd1234, zyxw9876, etcc. The letters portion is a prefix,

RE: Efficiency

2006-04-05 Thread Jerry Kassebaum
For my own amusement and edification, if nothing else: ## @myArray = (aacs1110, brbt4332, rtxa4320, aacs2000, brig5621, brbt5220, nbvc); #I'm using the assumption that the version numbers only increase in time. print @myArray\n\n; while($myArray[$x]) {

RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: Okay, Here's what I've come up with: -- @list = (aacs1110, brbt4332, rtxa4320, aacs2000, brig5621, brbt5220, nbvc); @list = sort @list; foreach $item (@list) { $itemPref = substr($item, 0, 4); $itemVers = substr($item, 4);

sleep oddness

2006-04-05 Thread Steven Manross
Has anyone seen an issue where sleep 1; causes an infinite loop in perl (100% CPU usage -- no movement in the script)? Build 816 in case it matters.. It just started happenning today in a script I wrote a very long time ago and haven't modified in a while. Similarly, running perl from the

RE: Efficiency

2006-04-05 Thread Steven Manross
@myArray = (aacs1110, brbt4332, rtxa4320, aacs2000, brig5621, brbt5220, nbvc); foreach $data (@myArray) { $data =~ /()()/; if ($hash{$1} $2) { $hash{$1} = $2; } } foreach $key (keys %hash) { print $key . = .$hash{$key}.\n; } Seems to work... Steven -Original

RE: Efficiency

2006-04-05 Thread Ng, Bill
That's incorrect though, since your output shows two copies of aacs and brbt ... Bill -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 5:02 PM To: Ng, Bill; perl-win32-users@listserv.ActiveState.com

RE: sleep oddness

2006-04-05 Thread Jan Dubois
On Wed, 05 Apr 2006, Steven Manross wrote: Has anyone seen an issue where sleep 1; causes an infinite loop in perl (100% CPU usage -- no movement in the script)? Build 816 in case it matters.. It just started happenning today in a script I wrote a very long time ago and haven't modified in a

Re: sleep oddness

2006-04-05 Thread Kevin J. Woolley
Steven Manross wrote: Has anyone seen an issue where sleep 1; causes an infinite loop in perl (100% CPU usage -- no movement in the script)? Build 816 in case it matters.. It just started happenning today in a script I wrote a very long time ago and haven't modified in a while. Similarly,

RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ng, Bill wrote: That's incorrect though, since your output shows two copies of aacs and brbt ... Bill -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 5:02 PM To: Ng, Bill;

RE: Efficiency

2006-04-05 Thread Nelson R. Pardee
Bill, I'm amused you call this efficiency when you said you didn't care about efficiency:-) Of course, it depends on one's definitions... Here are several I came up with, with times for sample data (3 data points): ($pref,$suf)=/(.{4})(.{4})/o; # Time for 3 .294

RE: Efficiency

2006-04-05 Thread Thomas, Mark - BLS CTR
Bill Ng wrote: Okay, Here's what I've come up with: -- @list = (aacs1110, brbt4332, rtxa4320, aacs2000, brig5621, brbt5220, nbvc); @list = sort @list; foreach $item (@list) { $itemPref = substr($item, 0, 4); $itemVers = substr($item, 4); $h{$itemPref} =

RE: Finding duplicate string in a set of files and sections

2006-04-05 Thread Paul
Thanks Peter, that will help. I am wondering if the use of anonymous hash and array may make more sense here than doing a bunch of `grep`. Can somebody show me how I would use it here? --- Peter Eisengrein [EMAIL PROTECTED] wrote: I have this program below that work correcly but the

RE: Efficiency

2006-04-05 Thread Ng, Bill
Mark, Whoops, one thing wrong with this ... since you don't sort before creating your hash, if the order of the data was such that the newer version appears earlier in the array, your results are wrong. Anyway you can throw the sort into the first line? Bill -Original Message-

RE: sleep oddness

2006-04-05 Thread Steven Manross
-Original Message- From: Jan Dubois [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 2:24 PM To: Steven Manross; perl-win32-users@listserv.ActiveState.com Subject: RE: sleep oddness On Wed, 05 Apr 2006, Steven Manross wrote: Has anyone seen an issue where sleep 1;

Language problem with Perl

2006-04-05 Thread Bullock, Howard A.
Test.Pl The test script attempts to use both Win32::NetAdmin::LocalGroupAddUsers and Win32::Lanman::NetLocalGroupAddMembers to add members to a specified group. But the name of the group passed to the methods does not appear to be correct when applied to the Hungarian. Please review the

Re: Language problem with Perl

2006-04-05 Thread Chris Wagner
At 06:21 PM 4/5/2006 -0400, Bullock, Howard A. wrote: #THIS SCRIPT WORKS CORRECTLY FOR OTHER OS LANGUAGES: # ENGLISH - WORKS (Administrators) # SPANISH - WORKS (Administratadores) # GERMAN - WORKS (Administratoren) # HUNGARIAN - FAILS (Rendszergazdák) WITH 2220 (group name could not be

Re: File Handle Pipes

2006-04-05 Thread Chris Wagner
At 10:30 PM 4/4/2006 -0700, David Wheeler wrote: Ah, no, I haven't. I was trying to avoid shell interpolation. But you're right, it just might be the simplest solution. If there are no shell metacharacters present, it won't start up a shell. So as long as the argument is a simple command,

RE: Language problem with Perl

2006-04-05 Thread Bullock, Howard A.
I bet this is the problem. The á character seems to be in unicode rather than ascii. U can try directly inputting it with Alt+0225 or doing chr(225) (or whatever it is in Hungarian encoding). Thanks, I believe you may be correct in that some characters are not being handled properly. But can

Re: Want to reduce the speed of execution in Perl script.

2006-04-05 Thread Chris Wagner
U had me confused. I thought u wanted to make this run slower because it was bogging down ur computer or something. But based on ur script comments and other posts it seems u want to make it run faster. So u want to reduce the time of execution not the speed of execution. At 05:18 PM 4/5/2006

RE: Language problem with Perl

2006-04-05 Thread Chris Wagner
At 08:59 PM 4/5/2006 -0400, Bullock, Howard A. wrote: Thanks, I believe you may be correct in that some characters are not being handled properly. But can anyone point me in the direction of generic solution so that this will function regardless of language? The data comes directly from