[28809] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 53 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 19 21:05:51 2007

Date: Fri, 19 Jan 2007 18:05:13 -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           Fri, 19 Jan 2007     Volume: 11 Number: 53

Today's topics:
        Connecting to a specific database using sybperl p.karunakaran@gmail.com
    Re: Connecting to a specific database using sybperl <mark.clementsREMOVETHIS@wanadoo.fr>
        error trapping in select dcruncher4@aim.com
    Re: error trapping in select <nobody@nowhere.com>
    Re: error trapping in select dcruncher4@aim.com
    Re: error trapping in select <nobody@nowhere.com>
    Re: error trapping in select dcruncher4@aim.com
    Re: error U1073: don't know how to make '/usr/lib/perl5 <ranrodrig@gmail.com>
    Re: error U1073: don't know how to make '/usr/lib/perl5 <sisyphus1@nomail.afraid.com>
    Re: help problemes cgi and GD::Text <john.swilting@wanadoo.fr>
    Re: I/O open() <bik.mido@tiscalinet.it>
    Re: I/O open() <novafyre@hotmail.com>
    Re: I/O open() <spamtrap@dot-app.org>
    Re: I/O open() <mmccaws@comcast.net>
    Re: I/O open() <spamtrap@dot-app.org>
    Re: need help with the tr and s/// <bik.mido@tiscalinet.it>
    Re: need help with the tr and s/// <novafyre@hotmail.com>
        Perl hash and rehash seeds; deterministic hash ordering ozgune@gmail.com
    Re: require vs. allow package reference <spamtrap@dot-app.org>
    Re: require vs. allow package reference <eponymousalias@yahoo.com>
        Search pattern not terminated at (Spreadsheet::Read exa <awkster@yahoo.com>
    Re: Undefined subroutine &main <pp@modulus.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Jan 2007 14:26:32 -0800
From: p.karunakaran@gmail.com
Subject: Connecting to a specific database using sybperl
Message-Id: <1169245592.194466.167160@38g2000cwa.googlegroups.com>

Hi,

How do I connect to a specific database in a database server using
sybperl or dbi

Thanks
Karunakaran



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

Date: Sat, 20 Jan 2007 01:09:48 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Connecting to a specific database using sybperl
Message-Id: <45b15dd0$0$27393$ba4acef3@news.orange.fr>

p.karunakaran@gmail.com wrote:
> Hi,
> 
> How do I connect to a specific database in a database server using
> sybperl or dbi
> 

You'll need DBI and DBD::Sybase. Both have copious documentation.

search.cpan.org

Mark


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

Date: 19 Jan 2007 13:54:48 -0800
From: dcruncher4@aim.com
Subject: error trapping in select
Message-Id: <1169243688.928206.234600@11g2000cwr.googlegroups.com>

I have a condition in which I have to ignore an error while SELECTING.
The error is lock timeout (Db2 error code -911). When fetchrow_arrayref

fetches the locked row, I do get -911 which I trap in my code. When I
move on to the next row doing another fetchrow_arrayref, I get error -3
(no statement executing). Does that mean that fetchrow_arrayref
will stop processing at the first error and there is no way to continue
to the next stop, ignoring it.

DB2 gurus: Is there a way to tell DB2 while SELECTING to ignore rows
which are locked by another session.

thanks.



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

Date: Fri, 19 Jan 2007 15:15:33 -0700
From: "Mark A" <nobody@nowhere.com>
Subject: Re: error trapping in select
Message-Id: <6uKdnYa08ZKc3izYnZ2dnUVZ_rKvnZ2d@comcast.com>

<dcruncher4@aim.com> wrote in message 
news:1169243688.928206.234600@11g2000cwr.googlegroups.com...
>I have a condition in which I have to ignore an error while SELECTING.
> The error is lock timeout (Db2 error code -911). When fetchrow_arrayref
>
> fetches the locked row, I do get -911 which I trap in my code. When I
> move on to the next row doing another fetchrow_arrayref, I get error -3
> (no statement executing). Does that mean that fetchrow_arrayref
> will stop processing at the first error and there is no way to continue
> to the next stop, ignoring it.
>
> DB2 gurus: Is there a way to tell DB2 while SELECTING to ignore rows
> which are locked by another session.
>
> thanks.

You can append WITH UR on the end of the select to not take any locks, and 
to ignore all locks taken by others.

There are some slightly less drastic measures that can be used to minimize 
lock contention, but not completely eliminate it like you can by using WITH 
UR. 




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

Date: 19 Jan 2007 14:42:12 -0800
From: dcruncher4@aim.com
Subject: Re: error trapping in select
Message-Id: <1169246532.087997.312150@q2g2000cwa.googlegroups.com>

Mark A wrote:
> You can append WITH UR on the end of the select to not take any locks, and
> to ignore all locks taken by others.
>
> There are some slightly less drastic measures that can be used to minimize
> lock contention, but not completely eliminate it like you can by using WITH
> UR.

I am aware of this, but I can't use this if I end up with
a phantom row (that is a row which I read but
rolled back subsequently). That is a BIG no in my
case.

Is there a way to get an indication from DB2 that
I am reading an uncomitted row. If I can get that,
then I can store it for the time being and then
revisit later to double check.



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

Date: Fri, 19 Jan 2007 16:16:25 -0700
From: "Mark A" <nobody@nowhere.com>
Subject: Re: error trapping in select
Message-Id: <fumdncuuEvPezCzYnZ2dnUVZ_v6tnZ2d@comcast.com>

<dcruncher4@aim.com> wrote in message 
news:1169246532.087997.312150@q2g2000cwa.googlegroups.com...
>
> I am aware of this, but I can't use this if I end up with
> a phantom row (that is a row which I read but
> rolled back subsequently). That is a BIG no in my
> case.
>
> Is there a way to get an indication from DB2 that
> I am reading an uncomitted row. If I can get that,
> then I can store it for the time being and then
> revisit later to double check.

I think you can use
SET CURRENT LOCK TIMEOUT 0
to immediately get -911 back if the row is locked, but to actually see the 
data, you will need to issue another SELECT and use WITH UR. 




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

Date: 19 Jan 2007 15:38:20 -0800
From: dcruncher4@aim.com
Subject: Re: error trapping in select
Message-Id: <1169249900.211426.265970@m58g2000cwm.googlegroups.com>

Mark A wrote:
> I think you can use
> SET CURRENT LOCK TIMEOUT 0
> to immediately get -911 back if the row is locked, but to actually see the
> data, you will need to issue another SELECT and use WITH UR.

after -911 error fetchrow_arrayref stops further processing.



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

Date: 19 Jan 2007 13:51:38 -0800
From: "ranrodrig" <ranrodrig@gmail.com>
Subject: Re: error U1073: don't know how to make '/usr/lib/perl5/5.8/cygwin/Config.pm', on win2k, how can I solve it?
Message-Id: <1169243498.502080.196670@l53g2000cwa.googlegroups.com>

Purl, thanks for the info I'm going to check it out.

Have a nice weekend.


Purl Gurl ha escrito:
> ranrodrig wrote:
>
> (snipped)
>
> > I'm trying to compile some perl pgms on my windows2k Sp3
>
> > ActivePerl 5.8.8.819
>
> > perl Makefile.pl, all is OK
>
> > nmake, I got the error described previously (U1073).
>
> > If I edit the Makefile, I found the following variables:
>
> > SITELIBEXP = /usr/lib/perl5/site_perl/5.8
> > SITEARCHEXP = /usr/lib/perl5/site_perl/5.8/cygwin
>
> > look for Perl on C:\Perl.
>
> > My question for you Folks would be: Do you know how to modify these env
> > variables that look like Linux ones, or if you have experienced this,
> > can you tell how did you solve it?.
>
> http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/Config.html
> 
> Purl Gurl



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

Date: Sat, 20 Jan 2007 12:46:46 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.com>
Subject: Re: error U1073: don't know how to make '/usr/lib/perl5/5.8/cygwin/Config.pm', on win2k, how can I solve it?
Message-Id: <45b1748a$0$9775$afc38c87@news.optusnet.com.au>


"ranrodrig" <ranrodrig@gmail.com> wrote in message 
news:1169223504.587985.211010@v45g2000cwv.googlegroups.com...
> I'm trying to compile some perl pgms on my windows2k Sp3 so I installed
> the following in order to do it:
>
> ActivePerl 5.8.8.819
> Cygwin 2.510.2.2 (without Perl)

ActivePerl doesn't need Cygwin.

> Parse::Binary module 0.10
>
> When I run:
>
> perl Makefile.pl, all is OK
>
> when I run:
>
> nmake, I got the error described previously (U1073).

Where did you get nmake ?
There's an old version (1.5, I think) of it available at Microsoft. It's not 
recommended.
With ActivePerl build 819, you're better off (imo) using dmake ( 
http://search.cpan.org/author/SHAY/dmake-4.7-20061120-SHAY/ ) and the MinGW 
compiler ( www.mingw.org ). They're free, and they work seamlessly with 
build 817 onwards.

>
> If I edit the Makefile, I found the following variables:
>
> LDDLFLAGS =  -s -L/usr/local/lib
> LDFLAGS =  -s -L/usr/local/lib
> LIBC = /usr/lib/libc.a
> LIB_EXT = .a
> OBJ_EXT = .o
> OSNAME = cygwin
> OSVERS = 1.5.18\(0.13242\)
> RANLIB = :
> SITELIBEXP = /usr/lib/perl5/site_perl/5.8
> SITEARCHEXP = /usr/lib/perl5/site_perl/5.8/cygwin
> SO = dll
> EXE_EXT = .exe
> FULL_AR = /usr/bin/ar
> VENDORARCHEXP = /usr/lib/perl5/vendor_perl/5.8/cygwin
> VENDORLIBEXP = /usr/lib/perl5/vendor_perl/5.8
>

This is not a Makefile that ActivePerl would generate. Looks like your 
Cygwin *does* contain a perl afterall - and probably a perl that doesn't 
contain Config.pm. A complete installation of perl on Cygwin *would* contain 
/usr/lib/perl5/5.8/cygwin/Config.pm - and the make program would then have 
nothing to complain about (on that score at least).

I'm surprised that 'nmake' was able to make any sense of that Makefile - as 
it was apparently generated by Cygwin's perl and would have been written for 
'make', not 'nmake'. Did you actually run 'nmake' ? Or did you run 'make' ? 
(If you want to run 'nmake.exe' you have to enter 'nmake'. If you enter 
'make' then you'll run 'make.exe'.)

First thing you need to do is decide which perl you want to run - Cygwin or 
ActivePerl. If you decide to run Cygwin's perl then the first thing to do is 
to install the bits of perl that are missing. There's probably a perl devel 
package that needs to be installed.

As another option, you might consider installing Strawberry Perl ( 
http://vanillaperl.com/ ). This is the best option (imo) as it will give you 
perl-5.8.8, dmake, and the MinGW compiler all in one hit - and save you from 
having to download and configure anything. Don't be too concerned about the 
'alpha' status. It's the *package* that's alpha. The individual components 
within that package are tried and true - certainly not 'alpha'.

Cheers,
Rob




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

Date: Fri, 19 Jan 2007 21:03:36 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: help problemes cgi and GD::Text
Message-Id: <45b12410$0$5107$ba4acef3@news.orange.fr>

Simon Andrews wrote:

> john.swilting wrote:
>> How to use GD::Text
>> 
>  > The documentation says
>  >
>  >  my $gd_text = GD::Text->new(
>  >        text => 'Some text',
>  >        font => 'funny.ttf',
>  >        ptsize => 14,
>  >    );
>> And I have
>> 
>> 
>> # create a new
>> 
>> my $im = new GD::Image(100,100);
> 
> [snip]
> 
>> print $q->header( -type => "image/png", -expires => "-1d");
>> binmode STDOUT;
>> print $im->png
>> 
>> How to make
>> So that both work together
> 
> I have to say that looking at the POD for GD::Text it's not at all
> obvious!  However if you look in the demos directory of the GD::Text
> module there is a nice example of how to do it
> 
> http://search.cpan.org/src/MVERB/GDTextUtil-0.86/demo/GDWrap.pl
> 
> Basically
> 
> my $gd = GD::Image->new(400,240);
> 
> my $wp = GD::Text::Wrap->new($gd,
>      width       => 180,
>      line_space  => 4,
>      color       => $black,
>      text        => $text,
> );
> 
> $gd->rectangle($wp->get_bounds(10,10), $blue);
> $wp->draw(10,10);
> 
> binmode STDOUT ;
> print STDOUT $gd->png();
Thank you

I have to look not at everything
At first




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

Date: Fri, 19 Jan 2007 21:58:30 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: I/O open()
Message-Id: <k1c2r2lrobedo32iuilarjnpkubbvq4eis@4ax.com>

On Fri, 19 Jan 2007 10:48:20 -0700, Mark Donovan
<novafyre@hotmail.com> wrote:

>Oh, an *amazing* improvement. Thank you so much, Dondi! I'm certain your

Are we at the level of ad hominem attacks?

>impressive insight will help Mike with his software installation problem in
>ways none of us can possibly imagine. Thank you, thank you, thank you!

Sorry for having offended your sensibility trying to help the OP
further...

>On 1/19/07 10:07, "Michele Dondi" <bik.mido@tiscalinet.it> wrote:
>
>> 
>> for maximum clarity...

wolfgang:~ [21:55:42]$ perl -e 'print @INC'
/etc/perl/usr/lib/perl5/vendor_perl/5.8.8/i686-linux/usr/lib/perl5/vendor_perl/5.8.8/usr/lib/perl5/vendor_perl/5.8.0/usr/lib/perl5/vendor_perl/5.8.2/usr/lib/perl5/vendor_perl/5.8.2/i686-linux/usr/lib/perl5/vendor_perl/5.8.4/usr/lib/perl5/vendor_perl/5.8.4/i686-linux/usr/lib/perl5/vendor_perl/5.8.5/usr/lib/perl5/vendor_perl/5.8.5/i686-linux/usr/lib/perl5/vendor_perl/5.8.6/usr/lib/perl5/vendor_perl/5.8.6/i686-linux/usr/lib/perl5/vendor_perl/5.8.7/usr/lib/perl5/vendor_perl/5.8.7/i686-linux/usr/lib/perl5/vendor_perl/usr/lib/perl5/site_perl/5.8.8/i686-linux/usr/lib/perl5/site_perl/5.8.8/usr/lib/perl5/site_perl/5.8.0/usr/lib/perl5/site_perl/5.8.0/i686-linux/usr/lib/perl5/site_perl/5.8.6/usr/lib/perl5/site_perl/5.8.6/i686-linux/usr/lib/perl5/site_perl/usr/lib/perl5/5.8.8/i686-linux/usr/lib/perl5/5.8.8/usr/local/lib/site_perl.wolfgang:~
[21:56:28]$ perl -le 'print for @INC'
/etc/perl
/usr/lib/perl5/vendor_perl/5.8.8/i686-linux
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.2/i686-linux
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.4/i686-linux
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.5/i686-linux
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.6/i686-linux
/usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.7/i686-linux
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/site_perl/5.8.8/i686-linux
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i686-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i686-linux
/usr/lib/perl5/site_perl
/usr/lib/perl5/5.8.8/i686-linux
/usr/lib/perl5/5.8.8
/usr/local/lib/site_perl
 .


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: Fri, 19 Jan 2007 15:34:45 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: I/O open()
Message-Id: <C1D69595.9712%novafyre@hotmail.com>

Of course not, I have nothing but genuine admiration for the stellar
magnitude of your contribution. How could anyone compete with brilliance of
your reply? It clarified everything for all of us! If was so strikingly
relevant to Mike's software installation problem. Who could imagine a more
useful and poignant reply than yours? And I was there... I saw it... The
glory of it all!

(with the forbearance of Steve Martin)

-- 
Regards,
Mark Donovan

On 1/19/07 13:58, "Michele Dondi" <bik.mido@tiscalinet.it> wrote:

> On Fri, 19 Jan 2007 10:48:20 -0700, Mark Donovan
> <novafyre@hotmail.com> wrote:
> 
>> Oh, an *amazing* improvement. Thank you so much, Dondi! I'm certain your
> 
> Are we at the level of ad hominem attacks?



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

Date: Fri, 19 Jan 2007 17:53:19 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: I/O open()
Message-Id: <m2r6tqzl0g.fsf@Sherm-Pendleys-Computer.local>

Mark Donovan <novafyre@hotmail.com> writes:

> Of course not, I have nothing but genuine admiration for the stellar
> magnitude of your contribution. How could anyone compete with brilliance of
> your reply? It clarified everything for all of us! If was so strikingly
> relevant to Mike's software installation problem.

OK, Mr. Genius, how about *you* explain how printing @INC (your idea, not
Michele's) is relevant to the fact that CPAN is fetching an ancient version
of Net::DNS?

While you're at it, how is expanding on your idea and showing a better way
to print @INC not helpful? (Beyond the fact that your initial idea wasn't
helpful to begin with, of course.)

Or better still, how about you just quit being such a crybaby and STFU
already! Do you intend to piss and moan about every damned post your
"enemy" makes from now on? What are you, five years old??? GROW UP.

sherm--

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


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

Date: 19 Jan 2007 15:39:49 -0800
From: "mmccaws2" <mmccaws@comcast.net>
Subject: Re: I/O open()
Message-Id: <1169249989.533582.307170@51g2000cwl.googlegroups.com>



On Jan 19, 2:53 pm, Sherm Pendley <spamt...@dot-app.org> wrote:
> Mark Donovan <novaf...@hotmail.com> writes:
> > Of course not, I have nothing but genuine admiration for the stellar
> > magnitude of your contribution. How could anyone compete with brilliance of
> > your reply? It clarified everything for all of us! If was so strikingly
> > relevant to Mike's software installation problem.OK, Mr. Genius, how about *you* explain how printing @INC (your idea, not
> Michele's) is relevant to the fact that CPAN is fetching an ancient version
> of Net::DNS?
>
> While you're at it, how is expanding on your idea and showing a better way
> to print @INC not helpful? (Beyond the fact that your initial idea wasn't
> helpful to begin with, of course.)
>
> Or better still, how about you just quit being such a crybaby and STFU
> already! Do you intend to piss and moan about every damned post your
> "enemy" makes from now on? What are you, five years old??? GROW UP.
>
> sherm--
>
> --
> Web Hosting by West Virginians, for West Virginians:http://wv-www.net
> Cocoa programming in Perl:http://camelbones.sourceforge.net

So when I get home I'll try those suggestions.  However, would it be
best for
me to uninstall all Net modules that I've attempted to install and
start fresh?

I think that what got me into this mess
is my lack of understanding modules, since this is my first adventure
into using them.

I chose that older one since it was mentioned in some article that
mentioned that author.

now when I query for a available modules I see the list:

Fetching with LWP:
  ftp://carroll.cac.psu.edu/pub/CPAN/modules/03modlist.data.gz
Going to read \.cpan\sources\modules\03modlist.data.gz
Going to write \.cpan\Metadata
Distribution    B/BB/BBB/Net-DNSServer-0.11.tar.gz
Distribution    C/CR/CREIN/Net-DNS-0.45.tar.gz
Distribution    D/DD/DDICK/Net-DNS-DynDNS-0.93.tar.gz
Distribution    G/GR/GRUBER/Net-DNS-ZoneCheck-0.01.tar.gz
Distribution    G/GS/GSM/Net-DNS-SEC-Validator-1.0b1.tar.gz
Distribution    H/HA/HARDAKER/Net-DNS-ZoneFile-Fast-0.7.tar.gz
Distribution
J/JM/JMEHNLE/net-dns-resolver-programmable/Net-DNS-Resolver-Prog
rammable-0.002.2.tar.gz
Distribution    L/LL/LLT/Net-DNS-Check-0.45.tar.gz
Distribution    L/LU/LUISMUNOZ/Net-DNS-Method-2.00.tar.gz
Distribution    L/LU/LUISMUNOZ/Net-DNS-Server-1.47.tar.gz
Distribution    L/LU/LUISMUNOZ/Net-DNS-ZoneFile-1.04.tar.gz
Distribution    M/MA/MASAHITO/Net-DNS-LivedoorDomain-DDNS-0.01.tar.gz
Distribution    M/MC/MCANTONI/Net-DNS-Version-0.01.tar.gz
Distribution    M/MI/MIKER/Net-DNS-Codes-0.09.tar.gz
Distribution    M/MI/MIKER/Net-DNS-ToolKit-0.30.tar.gz
Distribution    M/MI/MIKER/Net-DNSBL-MultiDaemon-0.18.tar.gz
Distribution    O/OL/OLAF/Net-DNS-0.59.tar.gz
Distribution    O/OL/OLAF/Net-DNS-SEC-0.12.tar.gz
Distribution    O/OL/OLAF/Net-DNS-SEC-0.14.tar.gz
Distribution    O/OL/OLAF/Net-DNS-TestNS-1.09.tar.gz
Distribution    O/OL/OLAF/Net-DNS-Zone-Parser-0.01.tar.gz
Distribution    T/TJ/TJMATHER/Net-DNSBLLookup-0.03.tar.gz
Distribution    T/TY/TYPESTER/Net-DNS-ValueDomain-DDNS-0.02.tar.gz
23 items found

In this list there are two Net-DNS only modules and many Net-DNS-XXXX
modules.  Are the latter, -XXX
named modules essentially a subset modules of Net-DNS or are they an
independent development module with completely different methods, in
other words developed from the same core module?

I have a similar problem with PcapUtils.

So it might be best to remove and search out the latest of each of the
dependencies.

Mike



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

Date: Fri, 19 Jan 2007 20:48:31 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: I/O open()
Message-Id: <m2mz4ezcwg.fsf@Sherm-Pendleys-Computer.local>

"mmccaws2" <mmccaws@comcast.net> writes:

> So when I get home I'll try those suggestions.  However, would it be
> best for
> me to uninstall all Net modules that I've attempted to install and
> start fresh?

No need - CPAN checks for older versions and will upgrade as needed.

> I think that what got me into this mess
> is my lack of understanding modules, since this is my first adventure
> into using them.
>
> I chose that older one since it was mentioned in some article that
> mentioned that author.

That must have been an old article. Modules can and often do pass from one
maintainer to another. (According to the docs at the bottom of Net::DNS's
POD, Olaf is actually its *third* maintainer.)

> In this list there are two Net-DNS only modules and many Net-DNS-XXXX
> modules.  Are the latter, -XXX
> named modules essentially a subset modules of Net-DNS or are they an
> independent development module with completely different methods, in
> other words developed from the same core module?

Neither. Net::DNS is just a name space. Module name spaces are chosen by
subject matter - they have nothing at all to do with who created them or
whether they happen to share any code or not.

If you need the Net::DNS module, then a simple "install Net::DNS" in the
CPAN shell should fetch the latest version of it - you don't need to know
or care about what specific version that is, or who the current maintainer
happens to be.

> So it might be best to remove and search out the latest of each of the
> dependencies.

No, what's best is to forget about managing dependencies at all. Let the
CPAN module do that for you - that's what it's for.

sherm--

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


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

Date: Fri, 19 Jan 2007 21:33:27 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: need help with the tr and s///
Message-Id: <rsu1r21o78g0fjldbcmhh6t28o1cbd1fif@4ax.com>

On Fri, 19 Jan 2007 07:21:26 -0700, Mark Donovan
<novafyre@hotmail.com> wrote:

>Dondi,
>
>It's unfortunate that your e-mail address doesn't work.
>
>Delivery to the following recipient failed permanently:
>
>     bik.mido@tiscalinet.it

Well, I strongly prefer to keep the discussion public, but if you
really want to you can write me at

  ti tod nfni tod im tod mcl ta razalb

(I hope you will decipher it, it's not that difficult - I won't post
it in any clearer form.)

>I take exception to your assertion. You are simply wrong. I, not you, decide
>what steps are necessary to illustrate the method I suggest. If you think
>you have a better solution, fine, post it. Your only contribution so far is

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>this obfuscated code which illustrates how badly perl can be abused.
>
>  $s2 =~ s/(.*?)0*\z/$1 . do{($s1 =~ m|(0*)\z|g)[0]}/e;

(BTW: I'd rewrite it like thus:

  $s2 =~ s/0*\z/($s1 =~ m|(0*)\z|g)[0]/e;

since there's no need and no educational value in capturing in s///.)

Your claim is plainly false: in fact that was sort of a joke (much
less so in its latest incarnation above, which is not obfuscated at
all and concise and clear enough IMO) in answer to a post of mine in
answer to yours, where I wrote

: >$s1 =~ m/(0*)\z/;
: >$len = length $1;
: >$s2 =~ s/(.*?)0*\z/$1/;

(BTW: I'd rewrite it like thus:

  $s2 =~ s/0*\z//;

since there's no need and no educational value in capturing in s///.)

: >$s2 .= '0' x $len;
: 
: This amounts  to getting a string of zeroes, getting its length and
: rebuild it based on this length, there's clearly an unnecessary
: passage:
: 
:   my ($pad) = $s1 =~ /(0*)\z/g;
:   $s2 =~ s/(.*?)0*\z/$1$pad/;

(BTW: I'd rewrite it like thus:

  $s2 =~ s/0*\z/$pad/;

since there's no need and no educational value in capturing in s///.)

I WANT TO STRESS THAT IT'S NOT ABOUT THE NUMBER OF STEPS/STATEMENTS:
You can still add a step to "my solution" much in the same vein as you
did, namely

  my ($pad) = $s1 =~ /(0*)\z/g;
  $s2 =~ s/0*\z//;
  $s2 .= $pad;

But there's no point and no *educational* value in taking the length
$len of $pad (although you call it $1) to reconstruct it by means of
'0' x $len. IT'S ALL ABOUT THE LOGIC: KISS!

>It makes nothing more clear. I don't like it. You said you don't like it.
>You may have a solution. I haven't seen it.

That's strange, because you replied to *that* post, not to the one
with the single statement...

>You seem to believe I have used some unnecessary perl statements in my
>answer. You said so. I agreed and I told you why. The perldocs have lots of
>examples of code that is not optimal. Why won't you accept that I might want
>to include steps that show something I think is important.

It seems I have difficulties explaining myself: I wasn't talking about
uunnecessary *statements* but of unnecessary *operations*. Even my one
statement only could be made to use the same logic:

  $s2 =~ s/0*\z/'0' x do{$s1 =~ m|(0*)\z|g; length $1}/e;

It's in the *logic* that I see a flaw, not in the number of
statements. 

>I don't need your instruction on how to answer questions. You have yet to

Yet I can comment if I see something potentially risky. I'm not
accusing you of anything, I don't think you will spoil our fellow
newbie. I still see a moderate risk of educating him to do A o B where
A o B = Id and one has no advantage in computing A and B where Id
would suffice in the first place.

>offer anything constructive or useful information to zim who asked the
>original question.

  my ($pad) = $s1 =~ /(0*)\z/g;
  $s2 =~ s/(.*?)0*\z/$1$pad/;

which I would now amend to

  my ($pad) = $s1 =~ /(0*)\z/g;
  $s2 =~ s/0*\z/$pad/;

or to the the (latest) one statement version, since it's very easy and
immediate now, and not obfuscated in any way.

>The four statements I posted allow someone to insert print statement that
>show the steps I chose to illustrate a method. For some reason, you felt
>your method is more clear than mine. Fine! I agreed, my method is not
>optimal, I said it. If you have a better method, post it. Instead, you

(Sorry to repeat myself, but) already done:

  my ($pad) = $s1 =~ /(0*)\z/g;
  $s2 =~ s/(.*?)0*\z/$1$pad/;

>persist in trying to push your solution on me. But your comments don't
>instruct me, I already know my code was not optimal. I explained that and
>still you try to tell me how I must answer a question to suit your
>preferences.

But you insist on explaining that your code is not optimal because of
the number of statements, which is not something I'm whining about.
You can add 10 intermediate statements if you feel that is
instructive. It's *not* instructive to do-and-undo. Not a big harm
done in this situation, but it could be made into a bad programming
habit.

>The reason I posted my reply over your quoted text is that I did not intend
>for you to reply. You might have taken the hint. In any case, whether I post

Then please explain why I shouldn't! Or do you hold the Absolute
Truth(TM)?!?

>above or below quoted material is not your concern. You certainly saw that
>my original post was below the quoted material. So you can assume I
>understand when to use that style and you can further assume that when I
>don't do it, I have a reason.

I can assume that indeed. Only I don't see any *good* one. The
comments in Tad McClellan's reply at
<news:slrner0727.lpu.tadmc@tadmc30.august.net> should help you to see
why I, and others, can't see any... but you're free to ignore our
concerns, of course.

>Frankly, I don't care if you're annoyed by someone who posts above quoted
>material in certain circumstances. It's not your place to correct me. You
>entirely miss the point of posting guidelines. The guidelines are not rules

Did I happen to mention the posting guidelines? Please check, you'll
see I didn't. I was and I am talking out of *common sense* and of
maximizing communication efficiency.

>for you to enforce. As I explained, the purpose of posting after quoted
>material is to make it easier for others to follow an extended discussion. I

Indeed. And I don't see any good reason why you arbitrarily decided
that your comments were not to be to be part of an extended discussion
others may be interested in reading.

>responded and agreed with you that my illustration was not optimal perl
>code. I let you know that my intent was to illustrate a method. No follow-up
>is required.

Still you let me know that in answer to a comment of mine. People
reading your post may want to read both my comment *and* your reply to
it. It's all a matter of courtesy and kindness. You may claim your
right not to be kind at all, of course. It's all up to you...

More importantly -trying to stress the concept once more in the
probably vain hope for you to understand that- you have been agreeing
and discussing on *one aspect* of your code's non-optimality which is
one I was not and I am not concerned with nor bothered by. I was
discussing a wholly different thing, which you still failed to
address, since you insist on talking about breaking the whole stuff in
several statements for the convenience of the OP to print intermediate
values. Which is not something I'm contesting in any way. While I was
and I am contesting the *logic* of doing-and-undoing, or if you
prefer, to perform the functional composition of a retraction with a
section, which amounts to identity - for no particularly good reason.


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: Fri, 19 Jan 2007 15:37:19 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: need help with the tr and s///
Message-Id: <C1D6962F.9713%novafyre@hotmail.com>

You have my e-mail address in the clear. Your preference. You choose.

--
Regards,
Mark Donovan


On 1/19/07 13:33, "Michele Dondi" <bik.mido@tiscalinet.it> wrote:

> On Fri, 19 Jan 2007 07:21:26 -0700, Mark Donovan
> <novafyre@hotmail.com> wrote:
> 
> Well, I strongly prefer to keep the discussion public, but if you
> really want to you can write me at
> 
>   ti tod nfni tod im tod mcl ta razalb
> 
> (I hope you will decipher it, it's not that difficult - I won't post
> it in any clearer form.)
> 



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

Date: 19 Jan 2007 14:01:00 -0800
From: ozgune@gmail.com
Subject: Perl hash and rehash seeds; deterministic hash ordering
Message-Id: <1169244060.089172.275420@a75g2000cwd.googlegroups.com>

Hi -

I just upgraded to Perl 5.8.6, and am evaluating the effect of random
hash ordering on my systems. Surprisingly, I seem *unaffected* by Perl
hash seeds (The following is a RHEL 3 box).

% perl -v
This is perl, v5.8.6 built for Linux-2.4c2.3-i686-64int

% perl -le '@a="a".."z";@a{@a}=();print keys %a'
HASH_SEED = 10308426221955932222
wraxdjyukhgftienvmslcpqbzo

% perl -le '@a="a".."z";@a{@a}=();print keys %a'
HASH_SEED = 2190859344420079461
wraxdjyukhgftienvmslcpqbzo

I tried this on a Fedora 3 box (5.8.6), and got the same behavior. On
OSX, the ordering is random as expected.

Looking into the source a little deeper, I see two different hash seeds
and two hash functions: PL_hash_seed (used by PERL_HASH) and
PL_rehash_seed (used by PERL_HASH_INTERNAL). PL_rehash_seed is
initialized in perl.c, but PL_hash_seed isn't.

"hv.c" seems to be calling PERL_HASH which relies on the uninitialized
seed. I added some printfs to the code, and ran perl:

% ./perl5.8.8 -le '@a="a".."z";@a{@a}=();print keys %a'
PL_hash_seed = 0
PL_rehash_seed = 17891139134198775779
IN HASH (NOT INTERNAL): PL_hash_seed = 0
IN HASH (NOT INTERNAL): PL_hash_seed = 0
 .........
wraxdjyukhgftienvmslcpqbzo


Why are there two different hash seeds and hash functions? How can I
know for sure which one is going to be called? 

Thanks,

Ozgun.



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

Date: Fri, 19 Jan 2007 14:10:49 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: require vs. allow package reference
Message-Id: <m21wlq25om.fsf@Sherm-Pendleys-Computer.local>

eponymousalias@yahoo.com writes:

> Essentially, I want require without its "die" semantics if the
> package cannot be found; I'd rather return a value to the calling
> program so it can adapt gracefully to local conditions.
>
> Is there some standard pattern/implementation for this?

Yes - generally you'd do the require() in a block eval() so you can catch
the die(). Something like this:

    unless ( eval { require Foo::Bar } ) {
        print $@;
    }

sherm--

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


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

Date: 19 Jan 2007 11:16:58 -0800
From: "Glenn" <eponymousalias@yahoo.com>
Subject: Re: require vs. allow package reference
Message-Id: <1169234218.273735.300710@q2g2000cwa.googlegroups.com>

> > Essentially, I want require without its "die" semantics if the
> > package cannot be found; I'd rather return a value to the calling
> > program so it can adapt gracefully to local conditions.
> >
> Rather than try to duplicate require() without the die(), just use
> require, and if it die()s, trap that die().  That's precisely what the
> eval() function is for:
>
> Hope this helps,
> Paul Lalli

Indeed it does.  I knew about die's change of behavior within eval,
but had forgotten ...  thanks much.



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

Date: 19 Jan 2007 17:33:03 -0800
From: "Jorge" <awkster@yahoo.com>
Subject: Search pattern not terminated at (Spreadsheet::Read example)
Message-Id: <1169256782.993635.236870@l53g2000cwa.googlegroups.com>

Using ActiveState perl 5.8.8 on XP, I'm attempting to use an example
from the Perl Hacks book by O'reilly.

It uses Spreadsheet::Read and simply retrieves the row and cell data
from a .xls file.

However, it throws this error ...

Search pattern not terminated at ...

and then points to this line ...

print join "\t" => map {$sheet->{cell}[$_][$row] // "-"} 1 ..
$sheet->{maxcol};

The only search pattern I see on this line is the 2 slashes (//) and as
far as I know, they are valid delimiters for search patterns and are
applied correctly. Can anyone shed some light on what this error could
mean?

I can post the complete program if needed.

Thank You

Jorge



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

Date: Sat, 20 Jan 2007 10:52:06 +1100
From: Pet <pp@modulus.org>
Subject: Re: Undefined subroutine &main
Message-Id: <12r2mdh5q95cv43@corp.supernews.com>

J. Gleixner wrote:
> Pet wrote:
>> Hi,
>>
>> I am writing a perl script create a imap folder.
>> I got the following error:
>>
>> Undefined subroutine &main:: called at 
>> /usr/local/lib/perl5/site_perl/5.8.8/IMAP/Admin.pm line 108.
>>
>> Does anyone seen this error before?
>> What is a potential way to fix it?
> 
> perldoc perldiag
> 
>  Undefined subroutine &%s called
>     (F) The subroutine indicated hasn't been defined, or if it was, it
>     has since been undefined.
> 
> Post a short example.  Also, what version of IMAP::Admin are you using?

I think I shouldn't use the version from Cyrus::IMAP::Admin.
Thsi is the version get me trouble.
The version from IMAP::Admin has no such problem, but this version has 
no subscribe/unsubscribe subroutine I can use.

Here is the example I used:

#!/usr/local/bin/perl

$localhost = 'mydot.com';

use mypg;
use Cyrus::IMAP::Admin;

$imap = Cyrus::IMAP::Admin->new('127.0.0.1');
$imap->authenticate(-mechanism => 'login', -user => 'cyrus', -password 
=> 'passadmin', -seperator => '/');
$db = mypg->new(connect_string => 'dbname=appdb user=root', debug=>0, 
persist=>0);

%imapusers = ();
@list = $imap->list("user/%");
foreach (@list) {
         if(/^user\/(.*)$/) {
                 $imapusers{$1} = 1;
         }
}

$db->query(q[SELECT id, username, password, allowlogin, updateflag FROM 
email_users]);
%newusers = $db->fetchmultikeyhash('username');

foreach $username (keys(%newusers)) {
         $password = $newusers{$username}[0]->{password};

         if($newusers{$username}[0]->{updateflag} eq 't') {
                 if($newusers{$username}[0]->{allowlogin} eq 't') {
                         if(!defined($imapusers{$username})) {

                                 $err = $imap->create("user/$username");
                                 die $imap->error if($err != 0);
                                 print "***err: $err; $username: 
$username is new user; $password\n";
                                 $err = $imap->set_acl("user/$username", 
"cyrus", "lrswipdca");
                                 print "++++err: $err; $username: 
$username is new user; $password\n";
                                 die $imap->error if($err != 0);
                                 print "===err: $err; $username: 
$username is new user; $password\n";
                         } else {
                                 print "$username: updating password\n";
                         }
                         print "$username: $username is new user; 
$password\n";
                 }
                 elsif($newusers{$username}[0]->{allowlogin} eq 'f') {

                         print "$username: disabling account\n";
                 }

         }
}

The offending line is at $imap->set_acl(...) in the example as shown above.

But if I changed back to "use IMAP::Admin" with the following constructor,

use IMAP::Admin;
$imap = IMAP::Admin->new('Server' => '127.0.0.1',
         'Login' => 'cyrus',
         'Password' => 'passadmin',
         'Separator' => "/",
         );

and without the use of $imap->authenticate(...) subroutine, there is no 
problem. Is because the 'Separator' parameter defined in the wrong way 
in the Cyrus::IMAP::Admin authenticate () subroutine I used?

Thanks
S


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

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


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