[28917] in Perl-Users-Digest
Perl-Users Digest, Issue: 161 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 22 00:10:07 2007
Date: Wed, 21 Feb 2007 21:09:08 -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, 21 Feb 2007 Volume: 11 Number: 161
Today's topics:
Cant connect to mysql from perl interface <rpallapotu@gmail.com>
Re: Cant connect to mysql from perl interface usenet@DavidFilmer.com
Re: Cant connect to mysql from perl interface <rpallapotu@gmail.com>
Re: Cant connect to mysql from perl interface <DJStunks@gmail.com>
Re: fork()-ing questions <tadmc@augustmail.com>
Re: how to handle Multi Value Hash output? sl123@netherlands.area
Re: net::mysql holds onto my query <lskatz@gmail.com>
Re: net::mysql holds onto my query dnikolayev@gmail.com
Re: new method to test Perl code <uri@stemsystems.com>
Re: Subclassing CGI::Pretty dies instantly in ->new , b <jeremy@chaos.org.uk>
Re: Subclassing CGI::Pretty dies instantly in ->new , b <uri@stemsystems.com>
ucfirst() with "_" separator <gors@invalid.no1>
Re: ucfirst() with "_" separator <uri@stemsystems.com>
Re: Unable to install Math::BigInt::GMP on Solaris 10 <tlviewer@yahoo.com>
Re: Unable to install Math::BigInt::GMP on Solaris 10 <DJStunks@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Feb 2007 16:07:01 -0800
From: "Ramesh" <rpallapotu@gmail.com>
Subject: Cant connect to mysql from perl interface
Message-Id: <1172102821.749990.152400@p10g2000cwp.googlegroups.com>
Hi,
I installed mysql on my windows xp machine. I am able to go to mysql
prompt and execute database commands. Howerver when I use DBI/
DBD::mysql to connect to the database I see my perl crashing. I am
running the perl script on the same machine where mysql is installed.
I am using perl 5.6.1 and DBD-mysql version 2.9.004. Mysql version is
5.0.27.
Can someone please give me some suggestions on how to fix this?
use DBI;
use Data::Dumper;
my @availabledrivers = DBI->available_drivers;
print Dumper @availabledrivers;
print "Before connect\n";
$dbh = DBI->connect("DBI:mysql:database=test", 'xxx', 'xxx');
Thanks.
-Ramesh.
------------------------------
Date: 21 Feb 2007 16:27:34 -0800
From: usenet@DavidFilmer.com
Subject: Re: Cant connect to mysql from perl interface
Message-Id: <1172104053.955087.214480@q2g2000cwa.googlegroups.com>
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)
------------------------------
Date: 21 Feb 2007 18:22:14 -0800
From: "Ramesh" <rpallapotu@gmail.com>
Subject: Re: Cant connect to mysql from perl interface
Message-Id: <1172110934.298872.224310@a75g2000cwd.googlegroups.com>
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.
------------------------------
Date: 21 Feb 2007 18:54:46 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Cant connect to mysql from perl interface
Message-Id: <1172112886.355144.27680@s48g2000cws.googlegroups.com>
On Feb 21, 7:22 pm, "Ramesh" <rpallap...@gmail.com> 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;
>
>
> 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.
what do you mean "crashes"?
-jp
------------------------------
Date: Wed, 21 Feb 2007 19:17:40 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: fork()-ing questions
Message-Id: <slrnetprpk.gj5.tadmc@tadmc30.august.net>
Darren Dunham <ddunham@redwood.taos.com> wrote:
> Monty <dale.schmitz@offutt.af.mil> wrote:
>> presume the child process attempts to return a value to the parent
>> process, but that's a matter better left for another conversation.
>
> The child doesn't attempt to do anything that's not in code.
>
> However, I suggest you examine the 'wait' function if you're interested
> in simple messages from the child to the parent.
And see the perlipc.pod manpage if you're interested in
more than "simple" messages.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Feb 2007 18:43:00 -0800
From: sl123@netherlands.area
Subject: Re: how to handle Multi Value Hash output?
Message-Id: <otvpt2tdhb5b6v89sa8qsqjnr6mnmm4cnt@4ax.com>
On 21 Feb 2007 09:44:46 -0800, "HansHG" <hgehrts@gmail.com> wrote:
>Hi all!
>
>I have a script that returns one SNMP OID from an SNMP Agent. It works
>perfectly:
>#!/usr/bin/perl -w
>use strict;
>use IO::Handle;
>use Net::SNMP;
>my $agentIdUniqueId = '.1.3.6.1.4.1.1977.1.1.2.1.0';
>sub getuid {
> my ($session, $error) = Net::SNMP->session
> (
> -hostname => shift || $_[0],
> -community => shift || $community,
> -port => shift || $port
> );
> my %hash = ($session->hostname, $result->{$agentIdUniqueId});
>
>while ( ($k, $v) = each %hash) {
> print "key $k value $v\n";
> }
>
>this works. But what do I do, when I have more than one varbind in my
>varbindlist? Like:
> my $result = $session->get_request(-varbindlist =>
>[$agentIdUniqueId,$agentIdName,$agentBuildDescription,
>$agentBuildVersion,$agentBuildNumber,$agentIdPlatformDescription]);
>
>How do I need to change the script so that it returns all requested
>OIDs? The query is done from perl. I can see the OIDs getting
>requested in wireshark. But how do I return them?
>
>please help
>cheers
>Hans
I'm not familiar with Net::SNMP but if it has a "get_request()" method
that returns a reference to an anonymous hash or array, then just loop
through it and print. Or like in your sub code there (callback?) just put
the reference in as the second (value) parameter and loop through it later,
or loop the return reference and add as many key value pairs as you want.
The "," in the hash asignment will always separate the key and value (the way
you are using it) unless it see's a "=>" separator but thats used when the lvalue
is a constant.... whatever.
Btw, you code didn't run on my machine.
asign it to the %hash variable second parameter
------------------------------
Date: 21 Feb 2007 15:34:10 -0800
From: "Lee" <lskatz@gmail.com>
Subject: Re: net::mysql holds onto my query
Message-Id: <1172100850.059798.76410@p10g2000cwp.googlegroups.com>
I set debug=true and got this information in case it helps anyone help
me...
Net::MySQL::_execute_command():
7A 03 00 00 03 53 45 4C 45 43 54 20 44 49 53 54 z....SELECT.DIST
49 4E 43 54 20 6E 69 4E 6F 64 65 31 2C 6E 69 4E INCT.niNode1,niN
6F 64 65 32 2C 6E 69 52 2C 6D 61 4E 6F 64 65 31 ode2,niR,maNode1
2C 6D 61 4E 6F 64 65 32 2C 6D 61 52 20 46 52 4F ,maNode2,maR.FRO
4D 28 0A 20 20 53 45 4C 45 43 54 20 6E 65 74 2E M(...SELECT.net.
6E 6F 64 65 31 20 41 53 20 6E 69 4E 6F 64 65 31 node1.AS.niNode1
2C 6E 65 74 2E 6E 6F 64 65 32 20 41 53 20 6E 69 ,net.node2.AS.ni
4E 6F 64 65 32 2C 6E 65 74 2E 72 20 41 53 20 6E Node2,net.r.AS.n
69 52 2C 63 6C 6F 6E 65 69 64 0A 20 20 46 52 4F iR,cloneid...FRO
4D 20 69 6E 74 65 72 73 65 63 74 69 6F 6E 2C 0A M.intersection,.
20 20 6E 65 74 77 6F 72 6B 20 6E 65 74 0A 20 20 ..network.net...
57 48 45 52 45 20 6C 69 6E 65 61 67 65 3D 27 4E WHERE.lineage='N
49 27 0A 20 20 41 4E 44 20 72 3E 30 2E 39 39 0A I'...AND.r.0.99.
20 20 41 4E 44 20 28 6E 65 74 2E 6E 6F 64 65 31 ..AND.(net.node1
20 49 4E 20 28 53 45 4C 45 43 54 20 63 6C 6F 6E .IN.(SELECT.clon
65 69 64 20 46 52 4F 4D 20 69 6E 74 65 72 73 65 eid.FROM.interse
63 74 69 6F 6E 29 20 41 4E 44 20 6E 65 74 2E 6E ction).AND.net.n
6F 64 65 32 20 49 4E 20 28 53 45 4C 45 43 54 20 ode2.IN.(SELECT.
63 6C 6F 6E 65 69 64 20 46 52 4F 4D 20 69 6E 74 cloneid.FROM.int
65 72 73 65 63 74 69 6F 6E 29 20 29 0A 20 20 41 ersection).)...A
4E 44 20 28 69 6E 74 65 72 73 65 63 74 69 6F 6E ND.(intersection
2E 63 6C 6F 6E 65 69 64 20 3D 20 6E 65 74 2E 6E .cloneid.=.net.n
6F 64 65 31 20 4F 52 20 69 6E 74 65 72 73 65 63 ode1.OR.intersec
74 69 6F 6E 2E 63 6C 6F 6E 65 69 64 20 3D 20 6E tion.cloneid.=.n
65 74 2E 6E 6F 64 65 32 29 0A 29 20 6E 69 45 64 et.node2).).niEd
67 65 2C 0A 28 0A 20 20 53 45 4C 45 43 54 20 6E ge,.(...SELECT.n
65 74 2E 6E 6F 64 65 31 20 41 53 20 6D 61 4E 6F et.node1.AS.maNo
64 65 31 2C 6E 65 74 2E 6E 6F 64 65 32 20 41 53 de1,net.node2.AS
20 6D 61 4E 6F 64 65 32 2C 6E 65 74 2E 72 20 41 .maNode2,net.r.A
53 20 6D 61 52 2C 63 6C 6F 6E 65 69 64 0A 20 20 S.maR,cloneid...
46 52 4F 4D 20 69 6E 74 65 72 73 65 63 74 69 6F FROM.intersectio
6E 2C 0A 20 20 6E 65 74 77 6F 72 6B 20 6E 65 74 n,...network.net
0A 20 20 57 48 45 52 45 20 6C 69 6E 65 61 67 65 ...WHERE.lineage
3D 27 4D 41 27 0A 20 20 41 4E 44 20 72 3E 30 2E ='MA'...AND.r.0.
39 39 0A 20 20 41 4E 44 20 28 6E 65 74 2E 6E 6F 99...AND.(net.no
64 65 31 20 49 4E 20 28 53 45 4C 45 43 54 20 63 de1.IN.(SELECT.c
6C 6F 6E 65 69 64 20 46 52 4F 4D 20 69 6E 74 65 loneid.FROM.inte
72 73 65 63 74 69 6F 6E 29 20 41 4E 44 20 6E 65 rsection).AND.ne
74 2E 6E 6F 64 65 32 20 49 4E 20 28 53 45 4C 45 t.node2.IN.(SELE
43 54 20 63 6C 6F 6E 65 69 64 20 46 52 4F 4D 20 CT.cloneid.FROM.
69 6E 74 65 72 73 65 63 74 69 6F 6E 29 20 29 0A intersection).).
20 20 41 4E 44 20 28 69 6E 74 65 72 73 65 63 74 ..AND.(intersect
69 6F 6E 2E 63 6C 6F 6E 65 69 64 20 3D 20 6E 65 ion.cloneid.=.ne
74 2E 6E 6F 64 65 31 20 4F 52 20 69 6E 74 65 72 t.node1.OR.inter
73 65 63 74 69 6F 6E 2E 63 6C 6F 6E 65 69 64 20 section.cloneid.
3D 20 6E 65 74 2E 6E 6F 64 65 32 29 0A 20 29 20 =.net.node2)..).
6D 61 45 64 67 65 0A 20 20 20 20 57 48 45 52 45 maEdge.....WHERE
20 28 6D 61 4E 6F 64 65 31 3D 6E 69 4E 6F 64 65 .(maNode1=niNode
31 20 41 4E 44 20 6D 61 4E 6F 64 65 32 3D 6E 69 1.AND.maNode2=ni
4E 6F 64 65 32 29 0A 20 20 20 20 4F 52 20 28 6D Node2).....OR.(m
61 45 64 67 65 2E 6D 61 4E 6F 64 65 32 3D 6E 69 aEdge.maNode2=ni
45 64 67 65 2E 6E 69 4E 6F 64 65 31 20 41 4E 44 Edge.niNode1.AND
20 6D 61 45 64 67 65 2E 6D 61 4E 6F 64 65 31 3D .maEdge.maNode1=
6E 69 45 64 67 65 2E 6E 69 4E 6F 64 65 32 29 0A niEdge.niNode2).
20 20 20 20 4F 52 44 45 52 20 42 59 20 6E 69 4E ....ORDER.BY.niN
6F 64 65 31 2C 6D 61 4E 6F 64 65 31 3B 0A ode1,maNode1;.
Net::MySQL::_execute_command():
01 00 00 01 06 38 00 00 02 03 64 65 66 0A 6D 69 .....8....def.mi
63 72 6F 61 72 72 61 79 03 6E 65 74 07 6E 65 74 croarray.net.net
77 6F 72 6B 07 6E 69 4E 6F 64 65 31 07 6E 69 4E work.niNode1.niN
6F 64 65 31 0C 21 00 3C 00 00 00 FD 01 10 00 00 ode1............
00 38 00 00 03 03 64 65 66 0A 6D 69 63 72 6F 61 .8....def.microa
72 72 61 79 03 6E 65 74 07 6E 65 74 77 6F 72 6B rray.net.network
07 6E 69 4E 6F 64 65 32 07 6E 69 4E 6F 64 65 32 .niNode2.niNode2
0C 21 00 3C 00 00 00 FD 01 10 00 00 00 30 00 00 .............0..
04 03 64 65 66 0A 6D 69 63 72 6F 61 72 72 61 79 ..def.microarray
03 6E 65 74 07 6E 65 74 77 6F 72 6B 03 6E 69 52 .net.network.niR
03 6E 69 52 0C 3F 00 16 00 00 00 05 01 10 1F 00 .niR.?..........
00 38 00 00 05 03 64 65 66 0A 6D 69 63 72 6F 61 .8....def.microa
72 72 61 79 03 6E 65 74 07 6E 65 74 77 6F 72 6B rray.net.network
07 6D 61 4E 6F 64 65 31 07 6D 61 4E 6F 64 65 31 .maNode1.maNode1
0C 21 00 3C 00 00 00 FD 01 10 00 00 00 38 00 00 .............8..
06 03 64 65 66 0A 6D 69 63 72 6F 61 72 72 61 79 ..def.microarray
03 6E 65 74 07 6E 65 74 77 6F 72 6B 07 6D 61 4E .net.network.maN
6F 64 65 32 07 6D 61 4E 6F 64 65 32 0C 21 00 3C ode2.maNode2....
00 00 00 FD 01 10 00 00 00 30 00 00 07 03 64 65 .........0....de
66 0A 6D 69 63 72 6F 61 72 72 61 79 03 6E 65 74 f.microarray.net
07 6E 65 74 77 6F 72 6B 03 6D 61 52 03 6D 61 52 .network.maR.maR
0C 3F 00 16 00 00 00 05 01 10 1F 00 00 05 00 00 .?..............
08 FE 00 00 32 00 05 00 00 09 FE 00 00 32 00 ....2........2.
... and it freezes here.
------------------------------
Date: 21 Feb 2007 15:42:17 -0800
From: dnikolayev@gmail.com
Subject: Re: net::mysql holds onto my query
Message-Id: <1172101337.464779.306690@s48g2000cws.googlegroups.com>
Try to use DBD::mysql throught DBI.
Net::Mysql was never the best method to "talk" with mysql..
Also, maybe you have a lot of data in DB and your query takes too long?
------------------------------
Date: Wed, 21 Feb 2007 19:45:02 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: new method to test Perl code
Message-Id: <x7fy8zkokx.fsf@mail.sysarch.com>
>>>>> "d" == dnikolayev <dnikolayev@gmail.com> writes:
d> On Feb 22, 12:21 am, Uri Guttman <u...@stemsystems.com> wrote:
>> >>>>> "d" == dnikolayev <dnikola...@gmail.com> writes:
>>
d> Here is the method to test perl program when you have no machine with
d> perl:http://www.codeide.com
d> You can do this in IDE mode in the site or run in CGI mode on your own
d> home page like here:http://nick.codeide.com/hello.cgi?name=Visitor
>>
>> why would you want to test perl code on a machine without perl? and do
>> you trust people to run any perl code on that box? i wouldn't go near
>> your box under any circumstances nor would i recommend anyone do so. it
>> isn't safe for your or their code.
d> Just to test some regexp or something, for instance.. Some regexp
d> or so on.. Show other one some abilities of perl,.. learn
d> language, give your children ability to test, etc.. There is a lof
d> of reasons to use.. Of course big applications wil not work as
d> needed.. This resource is for testing, learning and so on.
so it is a limited perl which means it isn't useful for testing. you can
install perl on any box you have direct access too (no need for root) so
you don't offer any advantage over that. learning from a limited perl is
not a good idea.
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: Wed, 21 Feb 2007 17:43:08 -0600
From: Jeremy Henty <jeremy@chaos.org.uk>
Subject: Re: Subclassing CGI::Pretty dies instantly in ->new , bug?
Message-Id: <slrnetpm5n.2cq.jeremy@omphalos.onepoint>
This is another auto-followup to thank everyone who posted
workarounds. I'll still send in a bug report, but first, sleep
beckons.
Jeremy Henty
------------------------------
Date: Wed, 21 Feb 2007 19:41:47 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Subclassing CGI::Pretty dies instantly in ->new , bug?
Message-Id: <x7k5ybkoqc.fsf@mail.sysarch.com>
>>>>> "a" == anno4000 <anno4000@radom.zrz.tu-berlin.de> writes:
a> Uri Guttman <uri@stemsystems.com> wrote in comp.lang.perl.misc:
>>
>> as i said, i looked at the CGI::Pretty code and couldn't see anything
>> obvious as to why it wouldn't work. there is one possible issue i can
>> think of. CGI is noted for doing dynamic loading of many of its
>> functions/methods and it does its own wierd way. maybe GGI::Pretty is
>> doing something that needs to be done in your module too to force
>> loading of the delete method? i see this line in CGI::Pretty and maybe
>> it will be a clue for you.
a> Your hunch is right about helping a class along to load its methods.
a> This is a workaround: In .../Jeremy/CLI.pm do
a> package Jeremy::CGI;
a> use base 'CGI::Pretty';
a> CGI::Pretty->can( $_) for qw( delete header cache);
a> 1; # success
a> The ->can query has the effect that later calls to the methods
a> actually succeed. I don't know what exactly happens, just
a> noticed the effect while looking into this.
>> $CGI::Pretty::AutoloadClass = 'CGI';
interesting. why his call to new() doesn't trigger the autoload of
delete but CGI::Pretty's new call does is the mystery.
>> also look into calling SUPER::new() instead of new() in your
>> module. CGI::Pretty does that and it might also help. calling SUPER:: is
>> common when inheriting constructors.
a> No, it's common when you override the constructor with your own. If
a> you inherit the constructor, there's no need (and no way) to use
a> SUPER::.
SUPER:: is normally used to call the parent class's initializer which
may not be called by its constructor. or some such variation. i thought
it might be a way to force autoloading of the missing methods in this
case. your call to can() seems to force it but again, why it is needed
is unknown. the OP should still ask stein about this IMO.
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: Wed, 21 Feb 2007 16:29:13 -0800
From: "gors" <gors@invalid.no1>
Subject: ucfirst() with "_" separator
Message-Id: <erio4r$f5f$1@aioe.org>
We have big file has lines as:
ITEM1 PRODUCT PRICE 3.47
ITEM2 PRODUCT_DETAILS PRICE 4.47
ITEM3 PRODUCT_DETAILS_AGAIN PRICE 5.47
Trouble is make 2nd word each line capital letter first, then lower case for
every "_". Some 2nd word have "_" one or more time, other not. So we like
make line each lokk like:
ITEM1 Product PRICE 3.47
ITEM2 Product_Details PRICE 4.47
ITEM3 Product_Details_Again PRICE 5.47
How operate on second word after each "_"? We try:
echo "ITEM3 PRODUCT_DETAILS_AGAIN PRICE 5.47" | \
perl -aF_ -ne '$stuff=ucfirst(lc $2); s/$2/$stuff/; print $_'
but it not work make any change. Even:
echo "PRODUCT_DETAILS_AGAIN" | \
perl -aF_ -ne 'print ucfirst(lc $_);'
produce only "Product_details_again" instead "Product_Details_Again".
Someone can help please?
------------------------------
Date: Wed, 21 Feb 2007 19:51:13 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: ucfirst() with "_" separator
Message-Id: <x7bqjnkoam.fsf@mail.sysarch.com>
>>>>> "g" == gors <gors@invalid.no1> writes:
g> ITEM3 PRODUCT_DETAILS_AGAIN PRICE 5.47
g> Trouble is make 2nd word each line capital letter first, then lower
g> case for every "_". Some 2nd word have "_" one or more time, other
g> not. So we like make line each lokk like:
g> ITEM3 Product_Details_Again PRICE 5.47
g> How operate on second word after each "_"? We try:
g> echo "ITEM3 PRODUCT_DETAILS_AGAIN PRICE 5.47" | \
g> perl -aF_ -ne '$stuff=ucfirst(lc $2); s/$2/$stuff/; print $_'
you aren't doing it for all the occurances of _. and that is not a good
way to do it anyhow.
read perldoc -q capital to see how it is done with words separated by
blanks. you should be able to modify that to use _. if you need more
help then show the new code here.
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: Wed, 21 Feb 2007 15:14:08 -0800
From: Mark Pryor <tlviewer@yahoo.com>
Subject: Re: Unable to install Math::BigInt::GMP on Solaris 10
Message-Id: <pan.2007.02.21.23.14.04.505737@yahoo.com>
On Wed, 21 Feb 2007 15:03:55 -0800, sumitbee wrote:
> Hello Guru's:
>
> Make fails on both version 1.18 and 1.19. I am trying to install this
> to speed up Net::SSH::Perl, since that is unbearably slow with the
> pure perl libraries, or even Math::BigInt::Pari, or
> Math::BigInt::FastCalc. here is what I get when I run make:
> --------------------------------------------------------------------------------------------------------------------
> 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
> bash-3.00# make
> cp lib/Math/BigInt/GMP.pm blib/lib/Math/BigInt/GMP.pm
> /usr/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/
> perl5/5.8.4/lib/ExtUtils/typemap -typemap typemap GMP.xs > GMP.xsc &&
> mv GMP.xsc GMP.c
> cc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -
> D_TS_ERRNO -xO3 -xspace -xildoff -DVERSION=\"1.19\" -DXS_VERSION=
> \"1.19\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"
> GMP.c
> "GMP.xs", line 4: cannot find include file: "gmp.h"
you need the header files for GMP. On fedora this is package
gmp-devel
#perl -MCPAN -e "test Math::BigInt"
on a fast machine this should return about 7-8 CPU seconds or less
once the GMP support is installed.
good luck,
Mark
------------------------------
Date: 21 Feb 2007 19:27:19 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Unable to install Math::BigInt::GMP on Solaris 10
Message-Id: <1172114839.281089.80420@m58g2000cwm.googlegroups.com>
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...
-jp
------------------------------
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 161
**************************************