[29904] in Perl-Users-Digest
Perl-Users Digest, Issue: 1147 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 3 03:11:07 2008
Date: Thu, 3 Jan 2008 00:10:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 3 Jan 2008 Volume: 11 Number: 1147
Today's topics:
Re: "Program Working" web page ? <jvs@india.ti.com>
$$listref[2][2] = "hello"; # what is $$listref ? <sensorflo@gmail.com>
Re: $$listref[2][2] = "hello"; # what is $$listref ? <bik.mido@tiscalinet.it>
Re: $$listref[2][2] = "hello"; # what is $$listref ? <ben@morrow.me.uk>
[newbie]How to call stored procedure using DBIx? <tonywinslow1986@gmail.com>
Re: [newbie]How to call stored procedure using DBIx? <Peter@PSDT.com>
Re: [newbie]How to call stored procedure using DBIx? <tonywinslow1986@gmail.com>
Re: [newbie]How to call stored procedure using DBIx? <Peter@PSDT.com>
Re: [newbie]How to call stored procedure using DBIx? <tonywinslow1986@gmail.com>
Re: [newbie]How to call stored procedure using DBIx? <ben@morrow.me.uk>
Re: [newbie]How to call stored procedure using DBIx? <tonywinslow1986@gmail.com>
Re: [newbie]How to call stored procedure using DBIx? <tonywinslow1986@gmail.com>
Re: Array reference <sensorflo@gmail.com>
Calling a function from a win32-DLL in perl <gur.tom@gmail.com>
Re: Calling a function from a win32-DLL in perl <kirakun@earthlink.net>
Re: Calling a function from a win32-DLL in perl <gur.tom@gmail.com>
Re: Calling a function from a win32-DLL in perl <ben@morrow.me.uk>
Re: close a filehandle for all processes himanshu.garg@gmail.com
Re: close a filehandle for all processes <joost@zeekat.nl>
Re: CMD in WinXP <mikeflan@earthlink.net>
Re: CMD in WinXP <veatchla@yahoo.com>
Re: CMD in WinXP <raherh@gmail.com>
Re: CMD in WinXP <mikeflan@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Dec 2007 10:33:05 +0530
From: Jahagirdar Vijayvithal S <jvs@india.ti.com>
Subject: Re: "Program Working" web page ?
Message-Id: <fkvbm9$a53$1@home.itg.ti.com>
* still just me <wheeledBobNOSPAM@yahoo.com> wrote:
> What is/are the technical approach(s) used to display "program
> working" web pages?
How about using <meta http-equiv="refresh" content="30">
on the result page? Generate the result page at start of the program
with a "program running" message and regenerate the page with the actual
results later.
>
> I understand the cgi cycle well... and I'm thinking that if I send a
> response page to the user with "program working" that then I'm all
> done - I can't send another page of output with the program results.
>
> I have a program that sometimes takes a little bit of time to run and
> unless the used watches the browser indicators, I'm concerned that
> they will terminate it early (before the results are sent to them).
> I can think of some ways to do this with Javascript in the client, but
> are there techniques to do this with cgi headers that are server
> driven?
>
> Thanks,
Regards
Jahagirdar Vijayvithal S
--
- "I don't suffer from insanity, I enjoy every minute of it." -- Charles Manson
Jahagirdar .V.S 91-80-25099129(O) 91-80-28540394(R)
IC Design Engineer
Texas Instruments (India) Ltd.
------------------------------
Date: Wed, 26 Dec 2007 08:40:23 -0800 (PST)
From: Florian Kaufmann <sensorflo@gmail.com>
Subject: $$listref[2][2] = "hello"; # what is $$listref ?
Message-Id: <0afd45d5-ccd8-422d-89f3-4f30bfb1e3aa@c49g2000hsc.googlegroups.com>
Hello
I am struggling a bit with the following example and text from
"Programming Perl".
$listref->[2][2] = "hello";
$$listref[2][2] = "hello";
(...) Therefore, it is $$listref and not $listref[2] that is taken to
be a reference to an array.
I would say, that $listref is a reference to the outer array, and $
$listref[2] (or the equivalent $listref->[2] or ${$listref}[2] ) a
reference to the third of the inner arrays. $$listref is invalid,
since it tries to scalar-dereference an array-reference. @$listref
would be ok, which array-dereferences the array-reference $listref.
Flo
------------------------------
Date: Wed, 26 Dec 2007 18:20:22 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: $$listref[2][2] = "hello"; # what is $$listref ?
Message-Id: <4835n39ppvotrtcvednrocncv5o7pkvrjl@4ax.com>
On Wed, 26 Dec 2007 08:40:23 -0800 (PST), Florian Kaufmann
<sensorflo@gmail.com> wrote:
>I am struggling a bit with the following example and text from
>"Programming Perl".
>
>$listref->[2][2] = "hello";
>$$listref[2][2] = "hello";
>(...) Therefore, it is $$listref and not $listref[2] that is taken to
>be a reference to an array.
I would say that it is ${$listref}[2] a.k.a. $listref->[2], i.e. the
element with subscript 2 in the array referenced by $listref, which is
also an arrayref.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 27 Dec 2007 20:52:57 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: $$listref[2][2] = "hello"; # what is $$listref ?
Message-Id: <9ufd45-ic6.ln1@osiris.mauzo.dyndns.org>
Quoth Florian Kaufmann <sensorflo@gmail.com>:
>
> I am struggling a bit with the following example and text from
> "Programming Perl".
>
> $listref->[2][2] = "hello";
> $$listref[2][2] = "hello";
> (...) Therefore, it is $$listref and not $listref[2] that is taken to
> be a reference to an array.
>
> I would say, that $listref is a reference to the outer array, and $
> $listref[2] (or the equivalent $listref->[2] or ${$listref}[2] ) a
> reference to the third of the inner arrays. $$listref is invalid,
> since it tries to scalar-dereference an array-reference. @$listref
> would be ok, which array-dereferences the array-reference $listref.
Yes. The point being made is that the expression parses as
${ $listref }[2]->[2]
rather than the
${ $listref[2] }[2]
or
${ $listref[2]->[2] }
that a C programmer might expect from analogy with *a[i]. That is, the
variable here is something like
my $listref = [[...], [...], ...];
rather that something like
my @listref = ([...], [...], ...);
The wording is less than ideal: as you say, $$listref, by itself, is a
runtime error. I think the the idea was that $$listref and not
$listref[2] is the subject of the postfix-[] operator, but Perl's
array-deref operator doesn't work the same as C's: it comes in two
parts, $ ... [...], which are inseparable.
Ben
------------------------------
Date: Fri, 28 Dec 2007 21:19:06 +0800
From: Tony Winslow <tonywinslow1986@gmail.com>
Subject: [newbie]How to call stored procedure using DBIx?
Message-Id: <fl31ob$bgm$1@news.cn99.com>
Hi, all!
I've stored procedures defined in my database schema, and I need to call
them in my code.
The arbitrary-sql approach won't help since it writes sql statements in
source code to act as stored procedures. So could I do that in DBIx?
Thank you!
------------------------------
Date: Fri, 28 Dec 2007 14:21:11 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <pan.2007.12.28.14.21.10.688440@PSDT.com>
On Fri, 28 Dec 2007 21:19:06 +0800, Tony Winslow wrote:
> I've stored procedures defined in my database schema, and I need to call
> them in my code.
> The arbitrary-sql approach won't help since it writes sql statements in
> source code to act as stored procedures. So could I do that in DBIx?
DBIx::What? In DBI, with a DBD::Oracle driver, I call stored procedures
with a database handle thus:
$dbh->do( "Begin somepackage.someprocedure; End;" );
It's picky about the semicolons.
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
------------------------------
Date: Fri, 28 Dec 2007 22:58:25 +0800
From: Tony Winslow <tonywinslow1986@gmail.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <fl37ik$e5e$1@news.cn99.com>
Peter Scott wrote:
> On Fri, 28 Dec 2007 21:19:06 +0800, Tony Winslow wrote:
>> I've stored procedures defined in my database schema, and I need to call
>> them in my code.
>> The arbitrary-sql approach won't help since it writes sql statements in
>> source code to act as stored procedures. So could I do that in DBIx?
>
> DBIx::What? In DBI, with a DBD::Oracle driver, I call stored procedures
> with a database handle thus:
>
> $dbh->do( "Begin somepackage.someprocedure; End;" );
>
> It's picky about the semicolons.
>
The env: Catalyst, DBIx::Class, MySQL
If I can get a $dbh from what I already have from DBIx::Class, the
problem can be solved. Yet I can figure out a way to get it.
------------------------------
Date: Sat, 29 Dec 2007 12:46:10 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <pan.2007.12.29.12.46.09.701875@PSDT.com>
On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
> The env: Catalyst, DBIx::Class, MySQL
> If I can get a $dbh from what I already have from DBIx::Class, the
> problem can be solved. Yet I can figure out a way to get it.
See DBIx::Class::Storage::DBI:
$schema->storage->dbh
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
------------------------------
Date: Sat, 29 Dec 2007 21:54:05 +0800
From: Tony Winslow <tonywinslow1986@gmail.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <fl5o6o$tib$1@news.cn99.com>
Peter Scott wrote:
> On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
>> The env: Catalyst, DBIx::Class, MySQL
>> If I can get a $dbh from what I already have from DBIx::Class, the
>> problem can be solved. Yet I can figure out a way to get it.
>
> See DBIx::Class::Storage::DBI:
>
> $schema->storage->dbh
>
I tried it and got the following error:
DBI Exception: DBD::mysql::st execute failed: OUT or INOUT argument 1
for routine MyWikiDB.countRevs is not a variable or NEW pseudo-variable
in BEFORE trigger [for Statement "CALL countRevs(?)" with ParamValues: ]
at /usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Schema.pm line 940
DBIx::Class::Schema::throw_exception('MyWikiDB=HASH(0xab1ab84)', 'DBI
Exception: DBD::mysql::st execute failed: OUT or INOUT ar...') called at
/usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Storage.pm line 121
DBIx::Class::Storage::throw_exception('DBIx::Class::Storage::DBI::mysql=HASH(0xab493f4)',
'DBI Exception: DBD::mysql::st execute failed: OUT or INOUT ar...')
called at /usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Storage/DBI.pm line 833
Part of my codes:
my $dbh = $c->model('MyWikiDB')->schema->storage->dbh;
my $sth = $dbh->prepare("CALL countRevs(?)");
my $cnt;
$sth->bind_param(1, \$cnt);
# my @cnt;
# $sth->bind_param(1, \@cnt);
$sth->execute;
; the procedure
DROP PROCEDURE IF EXISTS countRevs;
DELIMITER //
CREATE PROCEDURE countRevs (OUT rev_cnt INT)
BEGIN
SELECT COUNT(*) INTO rev_cnt FROM revisions;
END;
//
DELIMITER ;
The procedure looks stupid since I only wrote it to
find out how to call procedures.
------------------------------
Date: Sat, 29 Dec 2007 14:52:19 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <3i3i45-hdj.ln1@osiris.mauzo.dyndns.org>
Quoth Tony Winslow <tonywinslow1986@gmail.com>:
> Peter Scott wrote:
> > On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
> >> The env: Catalyst, DBIx::Class, MySQL
> >> If I can get a $dbh from what I already have from DBIx::Class, the
> >> problem can be solved. Yet I can figure out a way to get it.
> >
> > See DBIx::Class::Storage::DBI:
> >
> > $schema->storage->dbh
> >
> I tried it and got the following error:
>
> DBI Exception: DBD::mysql::st execute failed: OUT or INOUT argument 1
> for routine MyWikiDB.countRevs is not a variable or NEW pseudo-variable
<snip>
>
> Part of my codes:
> my $dbh = $c->model('MyWikiDB')->schema->storage->dbh;
> my $sth = $dbh->prepare("CALL countRevs(?)");
> my $cnt;
> $sth->bind_param(1, \$cnt);
Use ->bind_param_inout instead.
Ben
------------------------------
Date: Sun, 30 Dec 2007 10:26:34 +0800
From: Tony Winslow <tonywinslow1986@gmail.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <fl749p$tjs$1@news.cn99.com>
Ben Morrow wrote:
> Quoth Tony Winslow <tonywinslow1986@gmail.com>:
>> Peter Scott wrote:
>>> On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
>>>> The env: Catalyst, DBIx::Class, MySQL
>>>> If I can get a $dbh from what I already have from DBIx::Class, the
>>>> problem can be solved. Yet I can figure out a way to get it.
>>> See DBIx::Class::Storage::DBI:
>>>
>>> $schema->storage->dbh
>>>
>> I tried it and got the following error:
>>
>> DBI Exception: DBD::mysql::st execute failed: OUT or INOUT argument 1
>> for routine MyWikiDB.countRevs is not a variable or NEW pseudo-variable
> <snip>
>> Part of my codes:
>> my $dbh = $c->model('MyWikiDB')->schema->storage->dbh;
>> my $sth = $dbh->prepare("CALL countRevs(?)");
>> my $cnt;
>> $sth->bind_param(1, \$cnt);
>
> Use ->bind_param_inout instead.
>
> Ben
>
right before I see your post, i did it and got:
DBI Exception: DBD::mysql::st bind_param_inout failed: Output parameters
not implemented
------------------------------
Date: Sun, 30 Dec 2007 10:34:10 +0800
From: Tony Winslow <tonywinslow1986@gmail.com>
Subject: Re: [newbie]How to call stored procedure using DBIx?
Message-Id: <fl74o1$tmq$1@news.cn99.com>
Ben Morrow wrote:
> Quoth Tony Winslow <tonywinslow1986@gmail.com>:
>> Peter Scott wrote:
>>> On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
>>>> The env: Catalyst, DBIx::Class, MySQL
>>>> If I can get a $dbh from what I already have from DBIx::Class, the
>>>> problem can be solved. Yet I can figure out a way to get it.
>>> See DBIx::Class::Storage::DBI:
>>>
>>> $schema->storage->dbh
>>>
>> I tried it and got the following error:
>>
>> DBI Exception: DBD::mysql::st execute failed: OUT or INOUT argument 1
>> for routine MyWikiDB.countRevs is not a variable or NEW pseudo-variable
> <snip>
>> Part of my codes:
>> my $dbh = $c->model('MyWikiDB')->schema->storage->dbh;
>> my $sth = $dbh->prepare("CALL countRevs(?)");
>> my $cnt;
>> $sth->bind_param(1, \$cnt);
>
> Use ->bind_param_inout instead.
>
> Ben
>
I finally got a way out
see http://www.mysql.gr.jp/mysqlml/mysql/msg/11282
although written in Japanese, codes are readable
here comes my code:
my $dbh = $c->model('MyDB')->schema->storage->dbh;
$dbh->do('CALL countRevs(@rtnVal)');
my $cnt = $dbh->selectrow_array('SELECT @rtnVal');
Thank you all!
------------------------------
Date: Wed, 26 Dec 2007 08:22:46 -0800 (PST)
From: Florian Kaufmann <sensorflo@gmail.com>
Subject: Re: Array reference
Message-Id: <a7d60e47-81a1-4e29-b230-1152955d2092@v4g2000hsf.googlegroups.com>
another way is.
${$VAR}[0][0]
or slightly shorter
$$VAR[0][0]
A bit of explanation to all the suggested solutions:
Remember how you subscript a regular array: $array[0].
If you have a reference to an array instead of a simple array, you can
just replace 'array' with your reference, which gives you $
$RefToArray[0].
To be sure that you don't get into precedence problems, you can also
write ${$RefToArray}[0]. That's because "anywhere you'd put an
alphanumeric identifier as part of a variable or subroutine name, you
can replace the identifier with a block returning a reference of the
correct type." [quoted from "Programming Perl"]
An alternative syntax to $$RefToArray[0] (i.e. syntactic sugar) is to
use the -> operator as in $RefToArray->[0]. The left operand of ->
must be a reference to an array/hash. The right is an array/hash
subscript (never slice). Thus you could even also write ($RefToArray)-
>[0].
Putting this together for your case, where the you have a reference to
an array of references: To get the '04', you want to subscript the the
reference to the inner array, which is given by, as learned above,
$VAR->[0] (or $$VAR[0] or ${$VAR}[0] ). Subscripting is always of the
form $...[...], thus, in a first version, you get ${$VAR->[0]}[0]. If
you use the syntax sugar notation, you get ($VAR->[0])->[0], or
without the superfluous parentheses $VAR->[0]->[0]. (or $$VAR[0]->[0]
or ${$VAR}[0]->[0]). To be honest, I don't know why exactly the
parentheses are superfluous, I strongly assume because of operator
precedence/associativity rules.
The second -> is optional too, so you get the shorter $VAR->[0][0] (or
$$VAR[0][0] or ${$VAR}[0][0]) as suggested by Gunnar and Michele. To
quote Programming Perl again: "The arrow is optional between brackets
or braces, or between a closing bracket or brace and a parenthesis for
and indirect function call"
Flo
------------------------------
Date: Thu, 27 Dec 2007 04:17:36 -0800 (PST)
From: Tom Gur <gur.tom@gmail.com>
Subject: Calling a function from a win32-DLL in perl
Message-Id: <e6a82a49-c025-40fe-9e2e-0361dd8c5eb3@f53g2000hsg.googlegroups.com>
Hi,
How can I, within a perl script, call a certain function from a win32
DLL file ?
Thanks,
Tom
------------------------------
Date: Thu, 27 Dec 2007 08:20:25 -0500
From: Kira Yamato <kirakun@earthlink.net>
Subject: Re: Calling a function from a win32-DLL in perl
Message-Id: <2007122708202516807-kirakun@earthlinknet>
On 2007-12-27 07:17:36 -0500, Tom Gur <gur.tom@gmail.com> said:
> Hi,
>
> How can I, within a perl script, call a certain function from a win32
> DLL file ?
>
> Thanks,
> Tom
use Win32::API;
--
-kira
------------------------------
Date: Thu, 27 Dec 2007 06:14:01 -0800 (PST)
From: Tom Gur <gur.tom@gmail.com>
Subject: Re: Calling a function from a win32-DLL in perl
Message-Id: <1d113a3c-050d-4555-b522-06a0014e6adb@s8g2000prg.googlegroups.com>
On Dec 27, 3:20 pm, Kira Yamato <kira...@earthlink.net> wrote:
> On 2007-12-27 07:17:36 -0500, Tom Gur <gur....@gmail.com> said:
>
> > Hi,
>
> > How can I, within a perl script, call a certain function from a win32
> > DLL file ?
>
> > Thanks,
> > Tom
>
> use Win32::API;
>
> --
>
> -kira
Is there a way to do it using standard perl modules (without adding
modules) ?
------------------------------
Date: Thu, 27 Dec 2007 21:29:46 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Calling a function from a win32-DLL in perl
Message-Id: <a3id45-6j6.ln1@osiris.mauzo.dyndns.org>
Quoth Tom Gur <gur.tom@gmail.com>:
> On Dec 27, 3:20 pm, Kira Yamato <kira...@earthlink.net> wrote:
> > On 2007-12-27 07:17:36 -0500, Tom Gur <gur....@gmail.com> said:
> >
> > > How can I, within a perl script, call a certain function from a win32
> > > DLL file ?
> >
> > use Win32::API;
IIRC this only works for __stdcall functions, which applies all the
Win32 API functions in e.g. user32.dll, but not to ordinary C functions
exported from DLLs. These can only be called by using XS; the Inline::C
module provides a convenient way to wrap them if you don't want to write
XS, but it requires a C compiler. In principle chromatic's P5NCI ought
to be a good solution, but it doesn't work under Win32 yet.
> Is there a way to do it using standard perl modules (without adding
> modules) ?
Well, in *principle* you could use Dynaloader directly, but passing the
arguments and retrieving the return value would be well-nigh impossible.
Win32::API is installed with both ActivePerl and Strawberry Perl, so all
Win32 perl installations should include it.
Ben
------------------------------
Date: Thu, 27 Dec 2007 20:13:22 -0800 (PST)
From: himanshu.garg@gmail.com
Subject: Re: close a filehandle for all processes
Message-Id: <54976c77-5bb7-42a0-9486-9e5985436c89@b40g2000prf.googlegroups.com>
On Dec 24, 8:38 pm, Brian McCauley <nobul...@gmail.com> wrote:
> On Dec 24, 8:19 am,himanshu.g...@gmail.com wrote:
>
> > I have a process that opens a filehandle and after forking a
> > child closes the filehandle. The child can be used to run an arbitrary
> > command and I cannot do anything there.
>
> > Is there a way I can do a close for all the processes not just
> > the parent. Some equivalent of a shutdown for sockets?
>
> Your question has nothing to do with Perl.
:) I realized this shortly after sending the original post.
>
> As far as I know there is no such feature in the POSIX-like standards.
>
> Note you can close() handles in the child process between the fork()
> and the exec() if you are willing to operate at the lower level.
>
> You can also set the close-on-exec flag on a file descriptor. See the
> $^F special variable.
The scenario that I am in requires that I close the filehandles only
when the immediate child has died. Since this is the one execed and it
can be arbitrary command, close on exec may not work here.
>
> Note that by default all descriptors other than 0,1,2 will be have the
> close-on-exec() property anyhow so this is likely to be an non-issue
> anyhow.
I see. This could be useful.
Thanks,
HG
------------------------------
Date: Fri, 28 Dec 2007 12:19:59 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: close a filehandle for all processes
Message-Id: <87wsqznk0w.fsf@zeekat.nl>
himanshu.garg@gmail.com writes:
> On Dec 24, 8:38 pm, Brian McCauley <nobul...@gmail.com> wrote:
>> On Dec 24, 8:19 am,himanshu.g...@gmail.com wrote:
> The scenario that I am in requires that I close the filehandles only
> when the immediate child has died. Since this is the one execed and it
> can be arbitrary command, close on exec may not work here.
So you want to close the file-handle in the parent, when the child
dies? It will already be closed in the child, since when a process exits
all its handles are closed.
In that case you may be able periodically check if the child PID still
exists, or you can use SIGCHLD or system() or `` etc to get notified
automatically when the child process ends.
Joost.
------------------------------
Date: Wed, 26 Dec 2007 16:36:50 -0600
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: CMD in WinXP
Message-Id: <4772D782.C4F0456F@earthlink.net>
still just me wrote:
> On Sun, 23 Dec 2007 19:58:01 GMT, Jürgen Exner <jurgenex@hotmail.com>
> wrote:
>
> >Well, no. I agree with the OP, print()ing to the terminal in Windows is
> >quite slow.
>
> I have to go with the first followup - I don't have a particularly
> fast computer and yet printing output or error output is
> instantaneous.
>
> I think it's a system issue for the OP. What about other output to the
> command window from other MS Windows commands? How fast is a "dir" in
> a large directory?
Actually, Jurgen is correct.
Perl scripts run real fast as long as there is no output to
the cmd window. Even with output, if you have a
clear screen the output is real fast to fill up the window,
but then slows way down to print line-by-line, I guess
so you can read the output.
This only happens on XP. Win2000 cmd window is
super fast. I guess this is another "feature" MS made
to screw things up. I sure wish I could get the Win2000
cmd window over to XP, but just copying it over
produces the same effect.
I don't see any easy fixes, so I guess outputting to a file
and then opening the file is the way to go. Very annoying.
Thanks for the responses.
Mike
------------------------------
Date: Wed, 26 Dec 2007 19:45:28 -0600
From: l v <veatchla@yahoo.com>
Subject: Re: CMD in WinXP
Message-Id: <13n60tpe5ilb114@news.supernews.com>
Mike Flannigan wrote:
>
> still just me wrote:
>
>> On Sun, 23 Dec 2007 19:58:01 GMT, Jürgen Exner <jurgenex@hotmail.com>
>> wrote:
>>
>>> Well, no. I agree with the OP, print()ing to the terminal in Windows is
>>> quite slow.
>> I have to go with the first followup - I don't have a particularly
>> fast computer and yet printing output or error output is
>> instantaneous.
>>
>> I think it's a system issue for the OP. What about other output to the
>> command window from other MS Windows commands? How fast is a "dir" in
>> a large directory?
>
> Actually, Jurgen is correct.
>
> Perl scripts run real fast as long as there is no output to
> the cmd window. Even with output, if you have a
> clear screen the output is real fast to fill up the window,
> but then slows way down to print line-by-line, I guess
> so you can read the output.
>
> This only happens on XP. Win2000 cmd window is
> super fast. I guess this is another "feature" MS made
> to screw things up. I sure wish I could get the Win2000
> cmd window over to XP, but just copying it over
> produces the same effect.
>
> I don't see any easy fixes, so I guess outputting to a file
> and then opening the file is the way to go. Very annoying.
>
>
> Thanks for the responses.
>
>
> Mike
>
>
Does increasing the Command Prompts "Screen Buffer Size" improve
performance?
Command prompts on my XP laptop and Win2000 Server perform similarly.
For example, perl -e "for my $i (0 .. 10000) { print qq($i\n)}"
takes 02.553 seconds on my 3GHz server and 02.723 seconds on my 2GHz laptop.
--
Len
------------------------------
Date: Thu, 27 Dec 2007 20:25:21 +0000
From: rahed <raherh@gmail.com>
Subject: Re: CMD in WinXP
Message-Id: <uve6jkhqm.fsf@gmail.com>
Mike Flannigan <mikeflan@earthlink.net> writes:
> Perl scripts run real fast as long as there is no output to
> the cmd window. Even with output, if you have a
> clear screen the output is real fast to fill up the window,
> but then slows way down to print line-by-line, I guess
> so you can read the output.
>
> This only happens on XP. Win2000 cmd window is
> super fast. I guess this is another "feature" MS made
> to screw things up. I sure wish I could get the Win2000
> cmd window over to XP, but just copying it over
> produces the same effect.
Try console-2.00 from
http://sourceforge.net/project/showfiles.php?group_id=43764&package_id=36333&release_id=414524
which appears much faster than windows cmd.
--
Radek
------------------------------
Date: Sun, 30 Dec 2007 06:24:48 -0600
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: CMD in WinXP
Message-Id: <47778E10.EDCBD1F6@earthlink.net>
Mike Flannigan wrote:
> Actually, Jurgen is correct.
>
> Perl scripts run real fast as long as there is no output to
> the cmd window. Even with output, if you have a
> clear screen the output is real fast to fill up the window,
> but then slows way down to print line-by-line, I guess
> so you can read the output.
>
> This only happens on XP. Win2000 cmd window is
> super fast. I guess this is another "feature" MS made
> to screw things up. I sure wish I could get the Win2000
> cmd window over to XP, but just copying it over
> produces the same effect.
>
> I don't see any easy fixes, so I guess outputting to a file
> and then opening the file is the way to go. Very annoying.
>
> Thanks for the responses.
>
> Mike
Thanks for all the comments. Very good comments.
I plan to check into the console-2.00.
My searches of this problem led me to believe that it
was endemic to the WinXP OS. One informed
gentleman told me it is an indication that the graphics
drivers are not set up correctly. When I went back to
correct the problem, I was surprised to see the CMD
window now scrolls very fast - same as my Win2000
computer. It must be something I did, since I had MS
Update turned off, but I'm not sure what I did right.
My elapsed time on
for my $i (0 .. 10000) { print qq($i\n)}
is between 0.25 and 0.266 seconds on the Win2000
computer.
My elapsed time on
for my $i (0 .. 100000) { print qq($i\n)}
is 2.55 seconds on the Win2000 computer.
Mike
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1147
***************************************