[28919] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 163 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 22 14:10:23 2007

Date: Thu, 22 Feb 2007 11:09:09 -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, 22 Feb 2007     Volume: 11 Number: 163

Today's topics:
    Re: Cant connect to mysql from perl interface <rpallapotu@gmail.com>
    Re: fork()-ing questions <dale.schmitz@offutt.af.mil>
    Re: fork()-ing questions <jurgenex@hotmail.com>
    Re: fork()-ing questions <bik.mido@tiscalinet.it>
    Re: new method to test Perl code <paduille.4060.mumia.w+nospam@earthlink.net>
    Re: new method to test Perl code <paduille.4060.mumia.w+nospam@earthlink.net>
    Re: Newbie Question <mritty@gmail.com>
    Re: Newbie Question <ed_zep@ntlworld.com>
    Re: Newbie Question <paduille.4060.mumia.w+nospam@earthlink.net>
    Re: Newbie Question <ed_zep@ntlworld.com>
    Re: Newbie Question <mritty@gmail.com>
    Re: Newbie Question <mritty@gmail.com>
    Re: Newbie Question usenet@DavidFilmer.com
    Re: Newbie Question <jurgenex@hotmail.com>
    Re: Newlines and deprecations <jesse_hardy@premierinc.com>
    Re: Newlines and deprecations <mritty@gmail.com>
    Re: perl CPU utilization and socket I/O xhoster@gmail.com
    Re: printing all commands' return value in debugger <Peter@PSDT.com>
        Problem with Perl extensions <Lukasz.Odulinski@gmail.com>
    Re: ucfirst() with "_" separator <uri@stemsystems.com>
    Re: Unable to install Math::BigInt::GMP on Solaris 10 sumitbee@gmail.com
        Unicode-related problem installing perl modules on Sola <mikef@ack.berkeley.edu>
    Re: Unicode-related problem installing perl modules on  <spamtrap@dot-app.org>
    Re: Unicode-related problem installing perl modules on  <mikef@ack.berkeley.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 22 Feb 2007 08:24:45 -0800
From: "Ramesh" <rpallapotu@gmail.com>
Subject: Re: Cant connect to mysql from perl interface
Message-Id: <1172161485.617916.14200@h3g2000cwc.googlegroups.com>

On Feb 21, 11:24 pm, Tintin <tin...@invalid.invalid> wrote:
> Ramesh wrote:
> > On Feb 21, 4:27 pm, use...@DavidFilmer.com wrote:
> >> On Feb 21, 4:07 pm, "Ramesh" <rpallap...@gmail.com> wrote:
>
> >>> I see my perl crashing.
> >> You should never let Perl drive your car.
>
> >>> Can someone please give me some suggestions on how to fix this?
> >> Why are you asking us what the problem is when you haven't even asked
> >> Perl what the problem is?
>
> >>> $dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx');
> >> Try:
>
> >> $dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx')
> >>        or die $DBI::errstr;
>
> >> --
> >> The best way to get a good answer is to ask a good question.
> >> David Filmer (http://DavidFilmer.com)
>
> > Thanks for the tip. I added the die $DBI::errstr; as you suggested but
> > I still dont see any output. Cant figure out why perl crashes even
> > though I put this statement.
>
> Proper diagnosis of a problem requires exact error messages or
> description of how it's not behaving as expected.
>
> Perl crashes is as useless a description as "does not work".
>
> --
> Posted via a free Usenet account fromhttp://www.teranews.com- Hide quoted text -
>
> - Show quoted text -

I get the followin popup - "Perl Command Line Interpreter has
encountered a problem and needs to close. We are sorry for the
inconvenience". I clicked on Debug and I get - An exception 'Unhandled
Win32 Exception' has occured in perl.exe.



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

Date: 22 Feb 2007 08:35:41 -0800
From: "Monty" <dale.schmitz@offutt.af.mil>
Subject: Re: fork()-ing questions
Message-Id: <1172162141.850924.206400@m58g2000cwm.googlegroups.com>

Many thanks to all that posted on this one.  I believe I'm pretty
clear on how this works and have enjoyed the varyious methods of
approaching this understanding.  I say this not only to express
appreiation, but to ask what I hope is ONE LAST QUESTION on this
matter, but I have the sinking feeling that there is no such thing as
a final question, but I'm going to post it anyway.

Here's where I'm at: consider the code which was presented earlier in
the post:

unless ($pid = fork()) {
    # Do something as a child process
    exit;
}
# Do something as the parent process

on the execution of the fork, the statement '$pid = fork' evaluates as
true--I'm presuming from having run it--in the parent process (again,
assume success).  In the spawned child process...and here's the big
leap for me...the statement '$pid = fork' does not execute (since
another process is not spawned) and the original fork() call merely
provides a false value to the child process at the fork's point of
execution--in this case it also provides a 0 to the child's
 $pid variable.  The provided false value to the child process allows
the condition of the 'unless' statement to evaluate false and
therefore execute the 'unless' block of code.

Have I finally achieved enlightenment? :)



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

Date: Thu, 22 Feb 2007 16:47:00 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: fork()-ing questions
Message-Id: <8OjDh.1958$aM.1775@trndny03>

Monty wrote:
> unless ($pid = fork()) {
>    # Do something as a child process
>    exit;
> }
> # Do something as the parent process
>
> on the execution of the fork, the statement '$pid = fork' evaluates as
> true--I'm presuming from having run it--in the parent process (again,
> assume success).

So far, so good.

> In the spawned child process...and here's the big
> leap for me...the statement '$pid = fork' does not execute

Wrong. You are correct, the fork() itself is executed only once (i.e. in the 
parent process).
However the assignment $pid=[whatever] is the very first statement that is 
executed in the child process, too.

Maybe you are confused as to the execution sequence. In an assignment 
obviously you need to compute the value of the right-hand-side (RHS) first 
before assigning the result to the a variable.
Therefore first the fork() is executed (only once), now all of a sudden you 
got two individual processes, and in both processes the return value of 
fork() is assigned to their respective $pid variable, and then both 
processes continue execution.

jue 




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

Date: Thu, 22 Feb 2007 19:47:28 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: fork()-ing questions
Message-Id: <8nort25c4h7v29gttgmrhp78nq90crvgrk@4ax.com>

On 22 Feb 2007 08:35:41 -0800, "Monty" <dale.schmitz@offutt.af.mil>
wrote:

>assume success).  In the spawned child process...and here's the big
>leap for me...the statement '$pid = fork' does not execute (since
>another process is not spawned) and the original fork() call merely

It DOES execute! fork() is indeed a somewhat esoteric function: it
excutes in two different processes, one of which is created by itself.
It simply returns different values in each of them.

>Have I finally achieved enlightenment? :)

Sort of.


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, 22 Feb 2007 14:36:37 GMT
From: "Mumia W." <paduille.4060.mumia.w+nospam@earthlink.net>
Subject: Re: new method to test Perl code
Message-Id: <VThDh.2800$PL.431@newsread4.news.pas.earthlink.net>

On 02/21/2007 11:45 PM, dnikolayev@gmail.com wrote:
> [...]
> my $world = 'World';
> print "Hello, $world!";
> 
> and you run it and understands how it works, this is better, then wait
> for help from others or read a lot of books, etc..
> You can run some code, when you're away - just for modelling
> something, etc.
> 

Why does your site require javascript? I don't trust you enough to let 
you run javascript in my browser.

Your site is a completely blank page without javascript. I think 
something's up, but even if not, demanding javascript for all content 
generation demonstrates ignorance, and webmaster ignorance is enough of 
a reason to avoid your website.

Let's say you're for real. What defense do you have against this code?

print `cat /etc/passwd`;



-- 
Windows Vista and your freedom in conflict:
http://www.regdeveloper.co.uk/2006/10/29/microsoft_vista_eula_analysis/



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

Date: Thu, 22 Feb 2007 14:39:10 GMT
From: "Mumia W." <paduille.4060.mumia.w+nospam@earthlink.net>
Subject: Re: new method to test Perl code
Message-Id: <iWhDh.2801$PL.1586@newsread4.news.pas.earthlink.net>

On 02/22/2007 03:34 AM, dnikolayev@gmail.com wrote:
> Well, as for sysadmins.. you're right.. as for usual people - nope..
> Well, Just check - what people say in Social networks(most of them are
> not sysadmins):
> 
> http://del.icio.us/url/fefcd0119c6129ba8a8b7d104fdca8cc
> http://www.stumbleupon.com/url/codeide.com
> 

Well it seems you're for real, but I still don't like the javascript 
requirement.


-- 
Windows Vista and your freedom in conflict:
http://techdirt.com/articles/20061019/102225.shtml


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

Date: 22 Feb 2007 06:16:30 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Newbie Question
Message-Id: <1172153790.155370.244380@p10g2000cwp.googlegroups.com>

On Feb 22, 6:35 am, "Ed_Zep" <ed_...@ntlworld.com> wrote:
> Subject: Newbie Question

Please put the subject of your post in the Subject of your post.  This
tells us nothing about your question.

> I'm trying to install a few modules to get Perl on RH Linux AS 3.0 to
> speak to an Oracle 9.2.0.6 database.
> I'm installing as ROOT:
>
> Data-Dumper-2.121
> libnet-1.20
> DBI-1.53
> DBD-Oracle-1.19
>
> but when I check what's been installed

How, exactly, are you "checking what's been installed"?

> , all I get is:
>
> DBM, ExampleP, File, Proxy, Sponge

Well then pretty clearly you're either not correctly installing the
modules or not correctly checking for what modules you have installed.

> The script will be run by the oracle user but surely installing as
> root is correct.
>
> I've read the README, too... :)

You say that as though there's only one.  Which readme are you looking
at?

Have you read:
perldoc perlmodlib
and
perldoc -q installed
?

perl -MExtUtils::Installed -le'print for sort ExtUtils::Installed->new-
>modules()'
will show all non-core modules installed.

Paul Lalli



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

Date: 22 Feb 2007 07:09:49 -0800
From: "Ed_Zep" <ed_zep@ntlworld.com>
Subject: Re: Newbie Question
Message-Id: <1172156989.561884.158630@j27g2000cwj.googlegroups.com>

On Feb 22, 2:16 pm, "Paul Lalli" <mri...@gmail.com> wrote:
> On Feb 22, 6:35 am, "Ed_Zep" <ed_...@ntlworld.com> wrote:
>
> > Subject: Newbie Question
>
> Please put the subject of your post in the Subject of your post.  This
> tells us nothing about your question.
>
> > I'm trying to install a few modules to get Perl on RH Linux AS 3.0 to
> > speak to an Oracle 9.2.0.6 database.
> > I'm installing as ROOT:
>
> > Data-Dumper-2.121
> > libnet-1.20
> > DBI-1.53
> > DBD-Oracle-1.19
>
> > but when I check what's been installed
>
> How, exactly, are you "checking what's been installed"?
>
> > , all I get is:
>
> > DBM, ExampleP, File, Proxy, Sponge
>
> Well then pretty clearly you're either not correctly installing the
> modules or not correctly checking for what modules you have installed.
>
> > The script will be run by the oracle user but surely installing as
> > root is correct.
>
> > I've read the README, too... :)
>
> You say that as though there's only one.  Which readme are you looking
> at?
>
> Have you read:
> perldoc perlmodlib
> and
> perldoc -q installed
> ?
>
> perl -MExtUtils::Installed -le'print for sort ExtUtils::Installed->new->modules()'
>
> will show all non-core modules installed.
>
> Paul Lalli

Thanks, as explained I am a newbie. I read the README for all of the
modules. I'll run those commands and see what I get back.
Regards, Ed.



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

Date: Thu, 22 Feb 2007 15:15:26 GMT
From: "Mumia W." <paduille.4060.mumia.w+nospam@earthlink.net>
Subject: Re: Newbie Question
Message-Id: <isiDh.5277$Jl.1489@newsread3.news.pas.earthlink.net>

On 02/22/2007 05:35 AM, Ed_Zep wrote:
> Hi,
> I'm trying to install a few modules to get Perl on RH Linux AS 3.0 to
> speak to an Oracle 9.2.0.6 database.
> I'm installing as ROOT:
> 
> Data-Dumper-2.121
> libnet-1.20
> DBI-1.53
> DBD-Oracle-1.19
> 
> 
> but when I check what's been installed, all I get is:
> 
> DBM, ExampleP, File, Proxy, Sponge
> [...]


If this command does not generate an error, Data::Dumper has been 
installed successfully:

perl -MData::Dumper -e 1


-- 
Windows Vista and your freedom in conflict:
http://www.badvista.org/


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

Date: 22 Feb 2007 07:18:44 -0800
From: "Ed_Zep" <ed_zep@ntlworld.com>
Subject: Re: Newbie Question
Message-Id: <1172157524.334470.310740@s48g2000cws.googlegroups.com>

On Feb 22, 3:15 pm, "Mumia W." <paduille.4060.mumia.w
+nos...@earthlink.net> wrote:
> On 02/22/2007 05:35 AM,Ed_Zepwrote:
>
> > Hi,
> > I'm trying to install a few modules to getPerlon RH Linux AS 3.0 to
> > speak to an Oracle 9.2.0.6 database.
> > I'm installing as ROOT:
>
> > Data-Dumper-2.121
> > libnet-1.20
> > DBI-1.53
> > DBD-Oracle-1.19
>
> > but when I check what's been installed, all I get is:
>
> > DBM, ExampleP, File, Proxy, Sponge
> > [...]
>
> If this command does not generate an error, Data::Dumper has been
> installed successfully:
>
> perl-MData::Dumper -e 1
>
> --
> Windows Vista and your freedom in conflict:http://www.badvista.org/

Thanks very much, it didn't!

Regards, Ed.



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

Date: 22 Feb 2007 09:42:14 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Newbie Question
Message-Id: <1172166134.247043.198160@p10g2000cwp.googlegroups.com>

On Feb 22, 10:15 am, "Mumia W." <paduille.4060.mumia.w
+nos...@earthlink.net> wrote:
> On 02/22/2007 05:35 AM, Ed_Zep wrote:
>
> > Hi,
> > I'm trying to install a few modules to get Perl on RH Linux AS 3.0 to
> > speak to an Oracle 9.2.0.6 database.
> > I'm installing as ROOT:
>
> > Data-Dumper-2.121
> > libnet-1.20
> > DBI-1.53
> > DBD-Oracle-1.19
>
> > but when I check what's been installed, all I get is:
>
> > DBM, ExampleP, File, Proxy, Sponge
> > [...]
>
> If this command does not generate an error, Data::Dumper has been
> installed successfully:
>
> perl -MData::Dumper -e 1

This is a poor example, as Data::Dumper is a core module.  If that
module isn't found, the entire Perl installation is borked.  I have to
assume that the user was trying to install an updated version of the
module, one that doesn't come with Perl (though I've not actually
checked version numbers to verify that).

If you want to check that you've correctly installed a specfic version
of the module, try:
perl -MData::Dumper -le'print $Data::Dumper::VERSION'

Paul Lalli



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

Date: 22 Feb 2007 09:47:53 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Newbie Question
Message-Id: <1172166472.206736.112160@s48g2000cws.googlegroups.com>

On Feb 22, 10:09 am, "Ed_Zep" <ed_...@ntlworld.com> wrote:
> On Feb 22, 2:16 pm, "Paul Lalli" <mri...@gmail.com> wrote:
>
> > On Feb 22, 6:35 am, "Ed_Zep" <ed_...@ntlworld.com> wrote:
>
> > > Subject: Newbie Question
>
> > Please put the subject of your post in the Subject of your post.  This
> > tells us nothing about your question.
>
> > > I'm trying to install a few modules to get Perl on RH Linux AS 3.0 to
> > > speak to an Oracle 9.2.0.6 database.
> > > I'm installing as ROOT:
>
> > > Data-Dumper-2.121
> > > libnet-1.20
> > > DBI-1.53
> > > DBD-Oracle-1.19
>
> > > but when I check what's been installed
>
> > How, exactly, are you "checking what's been installed"?
>
> > > , all I get is:
>
> > > DBM, ExampleP, File, Proxy, Sponge
>
> > Well then pretty clearly you're either not correctly installing the
> > modules or not correctly checking for what modules you have installed.
>
> > > The script will be run by the oracle user but surely installing as
> > > root is correct.
>
> > > I've read the README, too... :)
>
> > You say that as though there's only one.  Which readme are you looking
> > at?
>
> > Have you read:
> > perldoc perlmodlib
> > and
> > perldoc -q installed
> > ?
>
> > perl -MExtUtils::Installed -le'print for sort ExtUtils::Installed->new->modules()'
>
> > will show all non-core modules installed.
>

> Thanks, as explained I am a newbie. I read the README for all of the
> modules. I'll run those commands and see what I get back.

Arg.  I don't want to start a flame war, so I'll be as calm as
possible here - "being a newbie" is not justification for this type of
post.  Saying "I checked what's been installed" without providing any
means of knowing what the heck you're talking about has nothing to do
with not knowing Perl.  It has to do with not thinking about how your
post is going to be read by anyone who's not you.  Typing a subject of
"Newbie question" that tells us nothing about what your question
actually is has nothing to do with not knowing Perl.  It has to do
with not putting any thought into your post.  Asking thousands of
people around the world a question before checking the built-in
documentation to see if your specific question is answered has nothing
to do with not knowing Perl.  If you somehow didn't know perldoc
exists, you should yell (a lot) at your teacher.  For future
reference, all of Perl's documentation is available to you via the
perldoc command.  Read more about it and all its uses at:
perldoc perldoc

If the above offends you, you have my apologies, and you should feel
free to ignore it and any other advice I might be able to offer.  I
hope, however, that you will instead take it under consideration,
rather than react with, "boy what an asshole *that* guy is!".

Paul Lalli



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

Date: 22 Feb 2007 10:33:52 -0800
From: usenet@DavidFilmer.com
Subject: Re: Newbie Question
Message-Id: <1172169232.108857.122130@j27g2000cwj.googlegroups.com>

On Feb 22, 9:42 am, "Paul Lalli" <mri...@gmail.com> wrote:
> perl -MData::Dumper -le'print $Data::Dumper::VERSION'

I've noticed that from a Windows cmd prompt I need to double-quote the
command. But I don't know why.

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



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

Date: Thu, 22 Feb 2007 18:54:46 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Newbie Question
Message-Id: <WFlDh.4399$ZF1.232@trndny02>

usenet@DavidFilmer.com wrote:
> On Feb 22, 9:42 am, "Paul Lalli" <mri...@gmail.com> wrote:
>> perl -MData::Dumper -le'print $Data::Dumper::VERSION'
>
> I've noticed that from a Windows cmd prompt I need to double-quote the
> command. But I don't know why.

Because that is the way the Windows command shell works.

jue 




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

Date: 22 Feb 2007 08:00:23 -0800
From: "jesse" <jesse_hardy@premierinc.com>
Subject: Re: Newlines and deprecations
Message-Id: <1172160023.073745.152060@k78g2000cwa.googlegroups.com>

On Feb 21, 11:50 am, "Paul Lalli" <mri...@gmail.com> wrote:
> On Feb 21, 11:08 am, "jesse" <jesse_ha...@premierinc.com> wrote:
>
>
>
>
>
> > I have a perl script that parses a file of backup failures.  I have it
> > print what failed and how many times it's failed. The log file lines
> > look like this:
>
> > c3devweb3 C:\\
> > c3devweb3 D:\\
>
> > This is the name of the server and what failed.  The scripts seems to
> > be working okay but there are some problems in the output.  Here is
> > the script.
>
> > #!/usr/bin/perl
> > #
> > use:strict;
> > use warnings;
> > my $file = "/export/home/jhardy/failed";
> > my %failures;
>
> > open(FAILED, "<", $file) or die "$!\n";
> >         while (<FAILED>) {
>
> You forgot to chomp.  That's why you have a newline in your output.
>
> chomp;
>
> >         s/#.*//;
> >         next if /^(\s)*$/;
> > my $failure = ( split,(/ /, $_) );
>
> You have two different errors here that are working in conjunction to
> produce almost-correct results.  For one, split should not have a
> comma before its first argument.  For two, it's using split in a
> depreciated context that's depreciated.  Fortunately, because you
> erroneously put that comma there, you're not getting the return value
> of split called in a scalar context stored into $failure.  Instead,
> you're getting $_ itself - the whole line.  Now because you're not
> complaining that you're getting the whole line of the file rather than
> just the part after the spaces, I can only assume that you really have
> no need to split at all.  So just assign $failure to $_:
> my $failure = $_;
>
> If you really did want to split the line and use just the last part of
> it, then call split in a list context, and get the last element of the
> returned list:
>
> my $failure = (split / /, $_)[0];
>
> Paul Lalli- Hide quoted text -
>
> - Show quoted text -

I have a major error in my logic and wanted to know if you could give
me some pointers.  I need to count the number of occurences for each
failure in the file but if the failure didn't happen the day of the
report I want to ignore any of those failures in the master file until
the failure happens again. I don't think I can really use a regular
expression because I'm not looking for a specific word.  I have 400
clients that I backup on a nightly basis and it could be any of those
400.



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

Date: 22 Feb 2007 09:39:25 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Newlines and deprecations
Message-Id: <1172165965.393549.121530@k78g2000cwa.googlegroups.com>

On Feb 21, 12:55 pm, "kens" <kenslate...@hotmail.com> wrote:
> On Feb 21, 11:50 am, "Paul Lalli" <mri...@gmail.com> wrote:
> > If you really did want to split the line and use just the last
> > part of it, then call split in a list context, and get the last
> > element of the returned list:
>
> > my $failure = (split / /, $_)[0];

> Looks like a typo - that will get the first element.
> The following would get the last:
>
> my $failure = (split / /, $_)[-1];

Quite so.  Thanks for pointing that out.

Paul Lalli




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

Date: 22 Feb 2007 18:50:46 GMT
From: xhoster@gmail.com
Subject: Re: perl CPU utilization and socket I/O
Message-Id: <20070222135222.333$a5@newsreader.com>

skyn3t@gmail.com wrote:
> I have a perl cgi script that reads from the network and outputs about
> 40K per second to the caller.
>
> The script is averaging about 15-25% CPU utilization, when it isn't
> doing much other than reading from the network, parsing the message,
> and printing it.

How do you know this?  This conflicts with what you report later.

> I want to get this CPU utilization down.

Why?

>
> Things I have tried:
>
> (1) Use SmallProf/DProf to get profiling information on the script and
> make adjustments. I made quite a few perl optimizations based on this
> data and it barely dented the CPU utilization.

What did SmallProf/DProf tell you?  We can't help you intepret these
results if you don't tell us what they were.

> (2) Convert the script to use sysread() to read the data in larger
> chunks than the perlio libs do. This did not change the CPU
> utilization at all.

I wouldn't expect it to make much of a difference.

> (3) Select on the socket before attempting reading from it, and bail
> if there is no data. Didn't help CPU.

I wouldn't expect that to make a difference, either, unless you are
using truly nonblocking IO, which is unusual.

>
> So what's causing it? I'm stumped.
>
> Here is what a 2 minute "time" call to my script looks like:
>
> real    2m8.469s
> user    0m1.557s
> sys     0m0.795s
>
> Should I be worried about the large discrepancy between the real time
> and the user+sys time?

You should be more worried that the your previously reported CPU
utilization is discrepant with the ratio of (user+sys)/real.

> This indicates that perl is idling quite a bit,
> correct? Is this normal for a perl application?

There is no normal for a Perl application.  A Perl program that is IO
bound will look pretty much like a non-Perl program that is IO bound.
A Perl program that is CPU bound will look pretty much like a non-Perl
program that is CPU bound.

> Any thoughts on how I can determine where the CPU utilization is
> coming from?

That is more of a systems problem than a Perl problem.  If I couldn't
figure out was going on using the system tools, then I'd make some
systematic changes to the program and see what happens.  What if it reads
from the socket and parses it, but just throws it away rather than
printing? What if it reads from the socket, and throws it away without
either parsing or printing?  What if it reads and then prints gibberish,
rather than parsing what it read?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Thu, 22 Feb 2007 15:05:31 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: printing all commands' return value in debugger
Message-Id: <pan.2007.02.22.15.05.30.232839@PSDT.com>

On Wed, 21 Feb 2007 10:21:19 -0800, yary wrote:
> I'm often using the debugger as a scratchpad to try things out. I'd
> like to see the return value of all commands I type, so I don't have
> to start each line with "p"- that is, something like:
> 
>> perl -de 1
> DB<1> $a=5
> 5
> DB<2> $a
> 5
> DB<3> print $a
> 5
> 1
> 
> I can't figure out how to twist the debugger commands/options around
> to get this "auto-print" going! Any ideas?

You could copy perl5db.pl and modify it to do what you want where it
decides to eval the input as Perl code.  Then invoke it via 

	perl -d:myperl5db ...

Personally I wouldn't, since I often do things in the debugger to modify
variables in the program like

	DB<1> @some_array = <very long list>

which would clog up your screen.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/



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

Date: 22 Feb 2007 11:05:18 -0800
From: "Lukasz Odulinski" <Lukasz.Odulinski@gmail.com>
Subject: Problem with Perl extensions
Message-Id: <1172171116.731994.59770@t69g2000cwt.googlegroups.com>

Hi
I'm trying to set up otrs on windows small businness server on IIS
6.0.
When I set perl.exe for .pl extension in IIS manager I see login
screen but when I try to login I get cgi error The specified CGI
application misbehaved by not returning a complete set of HTTP
headers.

I've changed perl.exe to perlis.dll for .pl extension and then browser
has returned html source instead of rendering it.

I've also tried the 3rd method perlEx30.dll and the browser rendered
good html page but it don't stop. The progress bar on the bottom of
firefox shows that page hasn't been downloaded fully yet. After a
while I get error about connection reset.



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

Date: Thu, 22 Feb 2007 13:07:05 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: ucfirst() with "_" separator
Message-Id: <x7ejoi2hiu.fsf@mail.sysarch.com>

>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:

  MD> On Thu, 22 Feb 2007 12:14:51 +0100, Michele Dondi
  MD> <bik.mido@tiscalinet.it> wrote:

  >> There may be more compact solutions, but a fairly understandable one
  >> is
  >> 
  >> s|(?<=\s)(\w+)(?=\s)|join '_', map ucfirst(lc), split /_/|e;

  MD> Well, of course there's a missing bit:

  MD>   s|(?<=\s)(\w+)(?=\s)|join '_', map ucfirst(lc), split /_/, $1|e;

  MD> What's worst, (I tested the former and) it took me a while to
  MD> understand what was wrong... :-(

  MD> of course a slight modification a' la Anno's suggestion in this same
  MD> thread is better:

  MD>   's|(?<=\s)(\w+)(?=\s)|join '_', map ucfirst, split /_/, lc $1|e;

i like this approach. it seems the term always starts with PRODUCT so i
assumed that. i sent the 3 lines from the OP into this one liner and it
works. not often you get to see nested s/// ops. :)


perl -lpe 's/(PROD\w+)/$x = $1 ; $x =~ s{([A-Z]+)}{\u\L$1}g ; $x/e'
ITEM1 PRODUCT PRICE 3.47
ITEM1 Product PRICE 3.47
ITEM2 PRODUCT_DETAILS PRICE 4.47
ITEM2 Product_Details PRICE 4.47
ITEM3 PRODUCT_DETAILS_AGAIN PRICE 5.47
ITEM3 Product_Details_Again PRICE 5.47

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 22 Feb 2007 08:10:32 -0800
From: sumitbee@gmail.com
Subject: Re: Unable to install Math::BigInt::GMP on Solaris 10
Message-Id: <1172160631.959752.317050@q2g2000cwa.googlegroups.com>

On Feb 21, 10:12 pm, Mark Pryor <tlvie...@yahoo.com> wrote:
> On Wed, 21 Feb 2007 19:27:19 -0800, DJ Stunks wrote:
> > On Feb 21, 4:03 pm, sumit...@gmail.com wrote:
> >> Make fails on both version 1.18 and 1.19.
> >> <snip>
> >> bash-3.00# perl Makefile.PL
> >> Note (probably harmless): No library found for -lgmp
> >> YAML not installed, make dist will not override metafile at
> >> Makefile.PL line 8.
> >> Writing Makefile for Math::BigInt::GMP
>
> > Why does the creation of the makefile for Math::BigInt::GMP say that
> > not finding the gmp library is "probably harmless"?  Seems like it
> > should be critical to me...
>
> If you are on Win32, try herehttp://www.kalinabears.com.au/w32perl/math_gmp.html
>
> --
> Mark

Mark, DJ, Thank you for your comments.  mark, Math::BigInt is
installed and tests succeed.  I am on Solaris, and cannot seem to find
the GMP header files.  From the Tel test results, it seems that v.
1.18 was the only one that passed tests on Solaris, but that is
failing for me as well.  Has anyone been able to install this on
Solaris?  Any other ideas as to how to speed up Net::SSH::Perl?

Thanks again,
Sumit



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

Date: Thu, 22 Feb 2007 16:21:43 +0000 (UTC)
From: Mike Friedman <mikef@ack.berkeley.edu>
Subject: Unicode-related problem installing perl modules on Solaris 10
Message-Id: <erkfun$162b$1@agate.berkeley.edu>

I'm trying to install (from CPAN) these two perl modules:

   HTML::TreeBuilder
   HTML::FormatText

on a Solaris 10 system.  The install fails and I get the following
messages, among others (some lines wrapped by me for readability):

============================================================
  Running make test
  PERL_DL_NONLAZY=1 /opt/csw/bin/perl "-MExtUtils::Command::MM" "-e"
   "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
  t/00system..........
  t/00system..........ok 1/2 t/00system..........ok
  t/assubs............  
  t/assubs............ok 1/74
  t/assubs............ok
  t/attributes........

  Wide character in print at
    /users/ist-rt/share/perl/5.8.8/Test/Builder.pm line 1172.
  
  Wide character in print at
   /users/ist-rt/share/perl/5.8.8/Test/Builder.pm line 1192.
  #  Failed test 'href should contain 'lang'
     (is: http://wherever/moo.cgi?xyz=123\342\214\251=en)'
  #   at t/attributes.t line 25.
  t/attributes........NOK 1# Looks like you failed 1 test of 1.
  t/attributes........dubious
    Test returned status 1 (wstat 256, 0x100)
  DIED. FAILED test 1
    Failed 1/1 tests, 0.00% okay
  
  ...
  
  Failed 1/17 test scripts, 94.12% okay. 1/746 subtests failed, 99.87% okay.
  *** Error code 29
  make: Fatal error: Command failed for target `test_dynamic'
    /usr/ccs/bin/make test -- NOT OK
  Running make install
    make test had returned bad status, won't install without force
============================================================

The above messages occur for both modules.  It appears to be a
Unicode problem.  Is there a way I can get these modules installed?

Thanks.

Mike


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

Date: Thu, 22 Feb 2007 12:55:55 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Unicode-related problem installing perl modules on Solaris 10
Message-Id: <m2ejoixej8.fsf@local.wv-www.com>

Mike Friedman <mikef@ack.berkeley.edu> writes:

> I'm trying to install (from CPAN) these two perl modules:
>
>    HTML::TreeBuilder
>    HTML::FormatText
>
> on a Solaris 10 system.  The install fails and I get the following
> messages, among others (some lines wrapped by me for readability):
>
>   ...
>   
>   Failed 1/17 test scripts, 94.12% okay. 1/746 subtests failed, 99.87% okay.
>   *** Error code 29
>   make: Fatal error: Command failed for target `test_dynamic'
>     /usr/ccs/bin/make test -- NOT OK
>   Running make install
>     make test had returned bad status, won't install without force
> ============================================================
>
> The above messages occur for both modules.  It appears to be a
> Unicode problem.  Is there a way I can get these modules installed?

With that high a success rate, that's likely either a *very* obscure bug
that you're unlikely to encounter in your own scripts, or a bug in the test
itself. I would certainly report the problem to the module author, but I'd
also do a "force install" on the problem modules. That will force the CPAN
shell to perform the "make install", even though the "make test" failed.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 22 Feb 2007 18:48:48 +0000 (UTC)
From: Mike Friedman <mikef@ack.berkeley.edu>
Subject: Re: Unicode-related problem installing perl modules on Solaris 10
Message-Id: <erkoig$1d0j$1@agate.berkeley.edu>

Sherm Pendley <spamtrap@dot-app.org> wrote:
> With that high a success rate, that's likely either a *very* obscure
> bug that you're unlikely to encounter in your own scripts, or a bug
> in the test itself. I would certainly report the problem to the module
> author, but I'd also do a "force install" on the problem modules. That
> will force the CPAN shell to perform the "make install", even though
> the "make test" failed.

Sherm,

I took your advice and now both modules are installed.  Interestingly,
after the first one (HTML::TreeBuilder) installed following the error
message, when I force-installed the other one (HTML::FormatText), all
its tests succeeded, which didn't happen all the other times I tried
(without force).

Anyway, I hope I'll be OK.  The application that needs these modules
is RT (Request Tracker, from Best Practical), which I'm in the
process of installing, so I can't yet say for sure if there will be
a problem.  I've not had this Unicode problem on Solaris 9 or on other
OS platforms.

Thanks.

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 163
**************************************


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