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
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
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
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
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
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,
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.
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
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
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
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
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)
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.
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.
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
[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,
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]) {
[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);
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
@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
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
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
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,
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;
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
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} =
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
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-
-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;
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
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
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,
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
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
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
35 matches
Mail list logo