[25389] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7634 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 12 11:05:50 2005

Date: Wed, 12 Jan 2005 08:05:28 -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           Wed, 12 Jan 2005     Volume: 10 Number: 7634

Today's topics:
    Re: 20050110: string join, substring, length <wyzelli@yahoo.com>
    Re: 20050111: list basics <bik.mido@tiscalinet.it>
    Re: cgi-bin script not printing output on html <1usa@llenroc.ude.invalid>
        CGI: Execute a perl script inside another perl script xdarcos@hotmail.com
    Re: CGI: Execute a perl script inside another perl scri <noreply@gunnar.cc>
    Re: CGI: Execute a perl script inside another perl scri <matternc@comcast.net>
    Re: CGI: Execute a perl script inside another perl scri xdarcos@hotmail.com
    Re: CPAN troubles again <kalinaubears@iinet.net.au>
    Re: DBI , Oracle, Shutting down <Mothra@mothra.com>
    Re: Deleting newlines in a text file <tadmc@augustmail.com>
    Re: differences <bik.mido@tiscalinet.it>
        effective sort on two fields in both searchorders (no F <pilsl@goldfisch.at>
    Re: effective sort on two fields in both searchorders ( <james@emarch.net>
    Re: effective sort on two fields in both searchorders ( <pilsl@goldfisch.at>
    Re: Execute a perl script inside another perl script <mritty@gmail.com>
    Re: Execute a perl script inside another perl script <jurgenex@hotmail.com>
    Re: How to calculate the number of bits skipped <nobull@mail.com>
    Re: How to calculate the number of bits skipped <bik.mido@tiscalinet.it>
        Looking for strategies for performance improvements lvirden@gmail.com
    Re: Looking for strategies for performance improvements <do-not-use@invalid.net>
    Re: Perl IDEs <Mothra@mothra.com>
    Re: Perl IDEs <phaylon@dunkelheit.at>
    Re: Perl IDEs <200501+news@foobox.com>
    Re: Print question <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 12 Jan 2005 11:36:05 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: 20050110: string join, substring, length
Message-Id: <FY7Fd.115931$K7.100926@news-server.bigpond.net.au>

"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message 
news:110120051004558257%jgibson@mail.arc.nasa.gov...
: In article <1105427394.732934.140900@f14g2000cwb.googlegroups.com>, Xah
: Lee <xah@xahlee.org> wrote:
:
: Please indicate that the following text applies only to Python. You
: preface the Perl sections this way, so why not the Python, especially
: for those of us who are reading your posts on comp.lang.perl.misc.
:
:
: > # index can be negative,
: > # and sometimes out of bound will just mean length of the string
: > print a[3:-2]
:
: Please tell those of us who do not know Python what exactly a[3:-2]
: means. And why "sometimes"? When does an out-of-bound array index mean
: the length of the string and when does it not? You seemed to assume
: that your readers all know Python. If that is the case, you should be
: posting only to comp.lang.python and not clpm.

Given the apparent lack of knowledge of either language should not be 
posting this rubbish at all.

P
-- 
print "Just another Perl Hacker";




------------------------------

Date: Wed, 12 Jan 2005 16:20:22 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: 20050111: list basics
Message-Id: <vm5au0p9ie55s0vj21t76s5mv6g0cek4op@4ax.com>

On 11 Jan 2005 22:52:53 -0800, "Xah Lee" <xah@xahlee.org> wrote:

># in perl, list is done with paren ().
># the at sign in front of variable is necessary.
># it tells perl that it is a list.
>@a = (0,1,2,'three',4,5,6,7,8,9);
>
># perl can't print lists. To show a list content,
[snip rest]

Please, be so gentle and stop posting this kind of things to clpmisc.
Nobody asked you and they won't benefit anybody.


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: 12 Jan 2005 13:32:01 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cgi-bin script not printing output on html
Message-Id: <Xns95DC56E05F2FCasu1cornelledu@132.236.56.8>

"Vikram" <vikram.keshavamurthy@gmail.com> wrote in 
news:1105515441.715069.75650@f14g2000cwb.googlegroups.com:

> I did install mkstool kit and was able to us `ls -1` instead of dir
> windows command, now it works, I presume your suggestion of using
> cygwin might also work. 

Provide some context. What are you replying to? I never suggested using 
cygwin. I only asked if you had cygwin installed in trying to understand 
the difference you were observing between command line operation versus CI 
operation.

Sinan.


------------------------------

Date: 12 Jan 2005 05:35:19 -0800
From: xdarcos@hotmail.com
Subject: CGI: Execute a perl script inside another perl script
Message-Id: <1105536919.024381.324070@c13g2000cwb.googlegroups.com>

Hello,

I am using perl scripts as CGI. What I want to do is to call another
perl script where I only set environment variables (envCGI.pl).

If I set these variables in my initial perl script, it works well (I
get my HTML page) but if I call the other perl script, I get:

[12/Jan/2005:10:43:22] failure (  632): for host 10.70.176.104 trying
to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
program C:\Perl\bin\perl.exe did not produce a valid header (program
terminated without a valid CGI header. Check for core dump or other
abnormal termination).

Here is my perl script:

#!C:/perl/bin/perl.exe

exec('envCGI.pl');

//Then an exe is executed (in which the content-type is set) and the
HTML page is well displayed.
$matchAdmin = "Routage%3DADMIN";
$matchConso = "Routage%3DCONSO";
if ($ENV{QUERY_STRING} =~ /$matchAdmin/)
{
$cmd = 'admin.exe'; exec($cmd);
}
elsif ($ENV{QUERY_STRING} =~ /$matchConso/)
{
$cmd = 'conso.exe'; exec($cmd);
}
else
{
$cmd = 'contrat.exe'; exec($cmd);
}

I tried also to use: system('envCGI.pl'). There are no errors but the
variables are not set. Is there an equivalent of EXPORT command of Unix
?

Thanks for your help
Xavier
Note:I am using SunOne Web Server 6.1 and I am under Windows 2000



------------------------------

Date: Wed, 12 Jan 2005 14:55:16 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI: Execute a perl script inside another perl script
Message-Id: <34koviF4bhcifU1@individual.net>

xdarcos@hotmail.com wrote:
> I am using perl scripts as CGI. What I want to do is to call another
> perl script where I only set environment variables (envCGI.pl).
> 
> If I set these variables in my initial perl script, it works well (I
> get my HTML page) but if I call the other perl script, I get:
> 
> [12/Jan/2005:10:43:22] failure (  632): for host 10.70.176.104 trying
> to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
> program C:\Perl\bin\perl.exe did not produce a valid header (program
> terminated without a valid CGI header. Check for core dump or other
> abnormal termination).
> 
> Here is my perl script:
> 
> #!C:/perl/bin/perl.exe

Why don't you have:

     use strict;
     use warnings;

> exec('envCGI.pl');

Have you read the docs for the exec() function?

     perldoc -f exec

> //Then an exe is executed (in which the content-type is set)

Odd way to set content-type in a Perl program.

> and the HTML page is well displayed.
> $matchAdmin = "Routage%3DADMIN";
> $matchConso = "Routage%3DCONSO";
> if ($ENV{QUERY_STRING} =~ /$matchAdmin/)
> {
> $cmd = 'admin.exe'; exec($cmd);
> }
> elsif ($ENV{QUERY_STRING} =~ /$matchConso/)
> {
> $cmd = 'conso.exe'; exec($cmd);
> }
> else
> {
> $cmd = 'contrat.exe'; exec($cmd);
> }
> 
> I tried also to use: system('envCGI.pl').

Have you read the docs for the system() function?

     perldoc -f system

Don't just try, read the docs, too.

Anyway, neither exec() nor system() is an appropriate way to include a 
Perl program in another Perl program. I suppose that you should use 'do' 
instead.

     do 'envCGI.pl';

See "perldoc -f do".

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 12 Jan 2005 10:15:37 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: CGI: Execute a perl script inside another perl script
Message-Id: <HuidnYQur-KGonjcRVn-jw@comcast.com>

xdarcos@hotmail.com wrote:

> Hello,
> 
> I am using perl scripts as CGI. What I want to do is to call another
> perl script where I only set environment variables (envCGI.pl).
> 
> If I set these variables in my initial perl script, it works well (I
> get my HTML page) but if I call the other perl script, I get:
> 
> [12/Jan/2005:10:43:22] failure (  632): for host 10.70.176.104 trying
> to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
> program C:\Perl\bin\perl.exe did not produce a valid header (program
> terminated without a valid CGI header. Check for core dump or other
> abnormal termination).
> 
> Here is my perl script:
> 
> #!C:/perl/bin/perl.exe
> 
> exec('envCGI.pl');

And nothing beyond this line executes, since envCGI.pl completely
replaces the currently running program.  perldoc -f exec.
> 
> //Then an exe is executed (in which the content-type is set) and the
> HTML page is well displayed.
> $matchAdmin = "Routage%3DADMIN";
> $matchConso = "Routage%3DCONSO";
> if ($ENV{QUERY_STRING} =~ /$matchAdmin/)
> {
> $cmd = 'admin.exe'; exec($cmd);
> }
> elsif ($ENV{QUERY_STRING} =~ /$matchConso/)
> {
> $cmd = 'conso.exe'; exec($cmd);
> }
> else
> {
> $cmd = 'contrat.exe'; exec($cmd);
> }
> 
> I tried also to use: system('envCGI.pl'). There are no errors but the
> variables are not set. 

Of course not.  system spawns a child process.  What the child
process does with its environment variables cannot affect the
parent.

> Is there an equivalent of EXPORT command of Unix 
> ?

Er, you don't understand environment variables.  Children cannot affect
the environment of their parents.  This is universally true in Unix, and
export can't--and doesn't--change that.
> 
> Thanks for your help
> Xavier
> Note:I am using SunOne Web Server 6.1 and I am under Windows 2000

Don't know much about environment variables in Windows, but your approach
seems to be fundamentally flawed.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


------------------------------

Date: 12 Jan 2005 07:28:45 -0800
From: xdarcos@hotmail.com
Subject: Re: CGI: Execute a perl script inside another perl script
Message-Id: <1105543725.272573.322870@f14g2000cwb.googlegroups.com>

Thanks all for your answers but it doesn't work yet :-(.
So OK, 'exec' is not the good solution, neither 'system'.
I didn't know the 'do' function, I tried it but without success: in my
exe, the environnement variables I have set in 'envCGI.pl' are still
unknown.

Regarding "perldoc -q environment" J=FCrgen, this is dedicated to Unix
and I am using Windows

Note that my exe is developed in C++, not in perl. The perl script is
here to call the right exe depending on the query string.
Any new help will be welcome.
Thanks
Xavier



------------------------------

Date: Wed, 12 Jan 2005 11:59:27 +0000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: CPAN troubles again
Message-Id: <41e5209f$0$27268$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

Josef Moellers wrote:

> Sisyphus (poor guy)

Five years of posting all over the place ... and finally, some sympathy.
Thanks Josef.

> Josef

Josef Möllers (Pinguinpfleger bei FSC)
     If failure had no penalty success would not be a prize
                         -- T.  Pratchett

If success were not a prize failure would incur no penalty.

Cheers,
Rob

-- 
To reply by email u have to take out the u in kalinaubears.



------------------------------

Date: Wed, 12 Jan 2005 11:25:53 GMT
From: Mothra <Mothra@mothra.com>
Subject: Re: DBI , Oracle, Shutting down
Message-Id: <5P7Fd.625098$2W1.51756@news.easynews.com>

"g3000" <carlton_gregory@yahoo.com> wrote in news:1105415095.667048.146320
@f14g2000cwb.googlegroups.com:

> Can you use DBI ( DBD::Oracle ) to shutdown and startup and Oracle8i
> database?
> 
> 

Yes, you can.  Get a DBA to help you out with the commands you need.


------------------------------

Date: Wed, 12 Jan 2005 07:47:18 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Deleting newlines in a text file
Message-Id: <slrncuaaj6.dd8.tadmc@magna.augustmail.com>

toomanyjoes@mail.utexas.edu <toomanyjoes@mail.utexas.edu> wrote:

> Any
> questions you guys can help me with I'll appreciate.


I notice that there *were no* questions in your article.
(questions end with a question mark.)

Did you mean to ask some questions?

Show us what you have tried so far, and we will help you fix it.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 12 Jan 2005 16:20:20 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: differences
Message-Id: <lvdau0ddug0qdbr6u73r6a90g351t8c92t@4ax.com>

On Mon, 10 Jan 2005 21:18:32 -0700, "Robin" <webmaster @
infusedlight.net> wrote:

>Subject: differences

Extremely bad chosen Subject. Include in you subject line what your
post is really about.

>What are respectively the difference with linux and windows installed on 
>different partitions and windows by itself perl on both machines has 
>reletively the same run time, but that is just a guess. I have just 

Huh?!? I can hardly grasp the syntax of the question -provided that
this is actually a question, for it's so convoulted that I'm not sure
(and OTOH I cannot see any question mark)- let alone the semantic.

So you want to know which are the differences between Linux and
Windows as far as something having to do with perl and execution times
is concerned, don't you? But... which is the actual question?!?

>installed suse linux 9.1 personal and am wondering how to get a hold of perl 
>modules and then install them. Let me know if this will be a problem for 
>some of you to answer or not. Anyway, thanks in advance.

Ditto as above!


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: Wed, 12 Jan 2005 14:08:20 +0100
From: peter pilsl <pilsl@goldfisch.at>
Subject: effective sort on two fields in both searchorders (no FAQ !)
Message-Id: <41e52197$1@e-post.inode.at>



$val={a=>[1,2],
       b=>[5,9],
       c=>[2,4],
       ...}

I need to sort the keys on the two fields (first field and then second 
field), so I use:

my @sort1= sort {
                  $val->{$a}->[0] <=> $val->{$b}->[0] ||
                  $val->{$a}->[1] <=> $val->{$b}->[1]
                 } keys %$val;

So far so good. Now I need - in the very next step - to do a second sort 
with opposite sort-order (second field and then first field)

my @sort2= sort {
                  $val->{$a}->[1] <=> $val->{$b}->[1] ||
                  $val->{$a}->[0] <=> $val->{$b}->[0]
                 } keys %$val;


The true $val is very big and I'm sure there is a much more efficient 
(and complex) way to get both searchorders in one step without doing all 
the <=>-operations twice.

thnx for any ideas,
peter

-- 
http://www2.goldfisch.at/know_list


------------------------------

Date: Wed, 12 Jan 2005 15:00:54 GMT
From: "James Tolley" <james@emarch.net>
Subject: Re: effective sort on two fields in both searchorders (no FAQ !)
Message-Id: <GYaFd.6562$7b.4501@trndny02>

"peter pilsl" <pilsl@goldfisch.at> wrote in message
news:41e52197$1@e-post.inode.at...
>
>
> $val={a=>[1,2],
>        b=>[5,9],
>        c=>[2,4],
>        ...}
>
> I need to sort the keys on the two fields (first field and then second
> field), so I use:
>
> my @sort1= sort {
>                   $val->{$a}->[0] <=> $val->{$b}->[0] ||
>                   $val->{$a}->[1] <=> $val->{$b}->[1]
>                  } keys %$val;
>
> So far so good. Now I need - in the very next step - to do a second sort
> with opposite sort-order (second field and then first field)
>

perldoc -f reverse

hth,

James




------------------------------

Date: Wed, 12 Jan 2005 16:12:38 +0100
From: peter pilsl <pilsl@goldfisch.at>
Subject: Re: effective sort on two fields in both searchorders (no FAQ !)
Message-Id: <41e53eb9$1@e-post.inode.at>

James Tolley wrote:
>>
>>So far so good. Now I need - in the very next step - to do a second sort
>>with opposite sort-order (second field and then first field) 
> 
> perldoc -f reverse
> 

thnx, but

I dont need the reversed sort-order, I need a different sort-order where 
the first sort-criteria is the second field and the second sort-criteria 
is the first field.

As I said: its no FAQ

p


> hth,
> 
> James
> 
> 


-- 
http://www2.goldfisch.at/know_list


------------------------------

Date: Wed, 12 Jan 2005 13:50:36 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Execute a perl script inside another perl script
Message-Id: <MW9Fd.7642$gb.5039@trndny03>

<xdarcos@hotmail.com> wrote in message
news:1105536919.024381.324070@c13g2000cwb.googlegroups.com...
> I am using perl scripts as CGI. What I want to do is to call another
> perl script where I only set environment variables (envCGI.pl).
>
> If I set these variables in my initial perl script, it works well (I
> get my HTML page) but if I call the other perl script, I get:
>
> [12/Jan/2005:10:43:22] failure (  632): for host 10.70.176.104 trying
> to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
> program C:\Perl\bin\perl.exe did not produce a valid header (program
> terminated without a valid CGI header. Check for core dump or other
> abnormal termination).
>
> Here is my perl script:
>
> #!C:/perl/bin/perl.exe
>
> exec('envCGI.pl');

You need to read up on what exec actually does
perldoc -f exec

<rest of code snipped>

> I tried also to use: system('envCGI.pl'). There are no errors but the
> variables are not set. Is there an equivalent of EXPORT command of
Unix
> ?

this launches an entirely seperate process.  Any environment variables
set in that process are set only for that process.

If your seperate file is only modifying globals (which %ENV is), you can
just use the do 'file' syntax.

perldoc -f do

Paul Lalli



------------------------------

Date: Wed, 12 Jan 2005 13:59:27 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Execute a perl script inside another perl script
Message-Id: <33aFd.11772$F97.10106@trnddc06>

xdarcos@hotmail.com wrote:
> Hello,
>
> I am using perl scripts as CGI. What I want to do is to call another
> perl script where I only set environment variables (envCGI.pl).
>
> If I set these variables in my initial perl script, it works well (I
> get my HTML page) but if I call the other perl script, I get:

Your Question is Asked Frequently, please see "perldoc -q environment":

  I {changed directory, modified my environment} in a perl script.  How come 
the change disappeared when I exited the script?  How do I get my changes to 
be visible?

jue 




------------------------------

Date: Wed, 12 Jan 2005 12:30:45 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to calculate the number of bits skipped
Message-Id: <cs34vs$4lr$1@sun3.bham.ac.uk>

In the middle of an unrelated thread s_g wrote:

[ Please don't do that ]

>    My file contains :
> 
> Compared      A     B     C    D
> Equivalent    2     24    56   2
> 
> Compared      A     C    
> Equivalent    2     4    
> 
> Compared      A     B     C    
> Equivalent    2     24    6    
> 
> Compared      C   
> Equivalent    5   
> 
> I want to calculate the total number of C's.But, the position(column) of
> C's get shifted.
> 
> Is there any function in perl to know the number of bits  from the
> beginning of the line to the current position?

You don't mean 'bits' you mean 'pieces' :-)

Rather than having concept of 'current position' and work out which 
piece the current position is in it it more natural to read line-wise 
and split the data.

#!/usr/bin/perl
use strict;
use warnings;

my (%totals,@legend);

while(<>) {
    my ($row_type,@cols) = split;
    next unless $row_type;
    if ( $row_type eq 'Compared' ) {
       @legend = @cols;
   } elsif ( $row_type eq 'Equivalent' ) {
       for ( @legend ) {
           $totals{$_} += shift @cols;
       }
   }
}

print "$totals{C}\n";



------------------------------

Date: Wed, 12 Jan 2005 16:20:22 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to calculate the number of bits skipped
Message-Id: <78eau056v8l14i4k5as5l1on6n1ajns93q@4ax.com>

On Wed, 12 Jan 2005 05:42:46 -0500, "s_g" <s_g@nospam.spike.com>
wrote:

>   My file contains :
>
>Compared      A     B     C    D
>Equivalent    2     24    56   2
[snip]
>I want to calculate the total number of C's.But, the position(column) of
>C's get shifted.

If you can rely on the format of the input file as of the example
portion you've given, you may try something along the lines of:


  #!/usr/bin/perl -ln
  
  use strict;
  use warnings;
  
  next unless /^Compared/;
  my @keys=split;
  $_=<>;
  my %hash; @hash{@keys}=split;
  our $tot+=$hash{C};
  
  END { print $tot };
  
  __END__


Of course in a real app you'd explicitly write the loop and add error
checks appropriately.

>Is there any function in perl to know the number of bits  from the
>beginning of the line to the current position?

No and I don't think that it would be relevant for your problem
however. Also, what do you mean with 'current position'? Are you
reading one charachter at a time?


HTH,
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: 12 Jan 2005 14:54:15 GMT
From: lvirden@gmail.com
Subject: Looking for strategies for performance improvements
Message-Id: <cs3dmn$ikp$1@srv38.cas.org>



A perl developer stopped by this morning with this question.
He has a new trainee that is learning Perl.  One of the early tasks
he has a need to complete is this.

He has an application that reads through terabytes of information,
searching for particular patterns and combinations.  The program
runs for days.  However, as the time that the program runs progresses,
it appears to produce results less frequently than expected.

When he notices this, he stops the application, starts it back up where
things left off, and the application returns to producing results at
the frequency expected - until, of course, the next time 8 or 10 or whatever
hours have gone by...

What tools might be available to a newbie perl developer that would assist
in analysing and improving an application exhibiting this sort of
behavior?
-- 
<URL: http://wiki.tcl.tk/> MP3 ID tag repair < http://www.fixtunes.com/?C=17038 >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvirden@gmail.com > <URL: http://www.purl.org/NET/lvirden/ >


------------------------------

Date: 12 Jan 2005 16:29:22 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Looking for strategies for performance improvements
Message-Id: <yzdbrbuoect.fsf@invalid.net>


lvirden@gmail.com writes:
> A perl developer stopped by this morning with this question.
> He has a new trainee that is learning Perl.  One of the early tasks
> he has a need to complete is this.
> 
> He has an application that reads through terabytes of information,
> searching for particular patterns and combinations.  The program
> runs for days.  However, as the time that the program runs progresses,
> it appears to produce results less frequently than expected.
> 
> When he notices this, he stops the application, starts it back up where
> things left off, and the application returns to producing results at
> the frequency expected - until, of course, the next time 8 or 10 or whatever
> hours have gone by...
> 
> What tools might be available to a newbie perl developer that would assist
> in analysing and improving an application exhibiting this sort of
> behavior?

This sounds more like a bug than bad performance. Here is one idea: if
the process produces A, B, C, D, then start a second run (process 2)
in parallel with the first one, starting from point B. Then watch the
output, hoping that process 2 will produce something that process 1
didn't. If and when that happens, maybe you're only into some
megabytes of input data, not terabytes, and can use the debugger with
some chance of success.

I suppose the Perl code in question uses "use warnings" and "use strict"?

If what the code does is not too complex, one path may be to
reimplement it; then assuming that, even if buggy, the new
implementation will find the items that the old one misses, after which
you can use the debugger on the old one. Or toss the old one and keep
the new one...

(Looking for bugs when processing immense amounts of data has a charm
of its own. For example when you have log files but they are so big
that no editor will take them.)


------------------------------

Date: Wed, 12 Jan 2005 11:19:13 GMT
From: Mothra <Mothra@mothra.com>
Subject: Re: Perl IDEs
Message-Id: <RI7Fd.623958$O24.94319@news.easynews.com>

"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in 
news:Xns951F9B54EE7CCelhber1lidotechnet@62.89.127.66:

> Thomas Kaufmann <merman@snafu.de> wrote:
> 
>> Hi there,
>> 
>> I'm a Perl-Newbie and I looking for good and modern Perl-IDEs. Can
>> you help me? 
> 
> 
> Console + screen + vim. Oh wait, you said modern. xterm + screen + vim.
> 
> 

vim?  what's wrong with vi?  or ed?

;o)


------------------------------

Date: Wed, 12 Jan 2005 12:35:06 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Perl IDEs
Message-Id: <pan.2005.01.12.11.35.06.295156@dunkelheit.at>

Mothra wrote:

> vim?  what's wrong with vi?  or ed?

I like that Completion-Feature of Eclipse. OTOH sometimes it lacks in
syntax-highlighting, specially things with an # in it.


p

-- 
http://www.dunkelheit.at/

»Better to reign in hell than to serve in heaven«
                             -- John Milton, »Paradise Lost«



------------------------------

Date: Wed, 12 Jan 2005 14:17:48 +0100
From: "Alain Star" <200501+news@foobox.com>
Subject: Re: Perl IDEs
Message-Id: <41e523df$0$22694$636a15ce@news.free.fr>

:::: I'm a Perl-Newbie and I looking for good and modern Perl-IDEs. Can
:::: you help me?

UltraEdit is very fine. You can even syntax check or run your script within.

AS
--
http://cri.ch/perl_neticq.html




------------------------------

Date: Wed, 12 Jan 2005 16:20:21 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Print question
Message-Id: <ca5au094qqtcphcitiosp1q2ajane0krdf@4ax.com>

On Tue, 11 Jan 2005 23:11:33 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:

>Is there a way to get Perl to print information on the display screen line
>at the same time that it is generated?

  $|++;


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: 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 V10 Issue 7634
***************************************


home help back first fref pref prev next nref lref last post