[31692] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2955 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 20 11:09:28 2010

Date: Thu, 20 May 2010 08:09:08 -0700 (PDT)
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, 20 May 2010     Volume: 11 Number: 2955

Today's topics:
    Re: bit-twiddling on 32-bit machines <hjp-usenet2@hjp.at>
    Re: bit-twiddling on 32-bit machines <nospam-abuse@ilyaz.org>
    Re: Debugging question: tracing the origin of an error. <stevem_clipthis_@clubtrout.com>
    Re: Debugging question: tracing the origin of an error. <ben@morrow.me.uk>
    Re: Debugging question: tracing the origin of an error. <r.ted.byers@gmail.com>
    Re: Debugging question: tracing the origin of an error. <r.ted.byers@gmail.com>
    Re: Debugging question: tracing the origin of an error. <r.ted.byers@gmail.com>
        getting results of multiple simultaneous system command <lndresnick@gmail.com>
    Re: getting results of multiple simultaneous system com <rvtol+usenet@xs4all.nl>
        How do I check if www site has Perl compatible? <John.Smith@invalid.com>
    Re: How do I check if www site has Perl compatible? <peter@makholm.net>
    Re: How do I check if www site has Perl compatible? <RedGrittyBrick@spamweary.invalid>
    Re: How do I check if www site has Perl compatible? <John.Smith@invalid.com>
    Re: How do I check if www site has Perl compatible? <ben@morrow.me.uk>
    Re: How do I check if www site has Perl compatible? (Randal L. Schwartz)
        How to avoid zombies? <christoph.rabel@gmail.com>
    Re: How to avoid zombies? (Randal L. Schwartz)
    Re: How to avoid zombies? <christoph.rabel@gmail.com>
    Re: ls in ftp fails <mikaelpetterson@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 20 May 2010 13:02:08 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: bit-twiddling on 32-bit machines
Message-Id: <slrnhva5lh.bco.hjp-usenet2@hrunkner.hjp.at>

On 2010-05-19 23:56, sln@netherlands.com <sln@netherlands.com> wrote:
> On Wed, 19 May 2010 23:44:50 +0100, Ben Morrow <ben@morrow.me.uk> wrote:
>
>>and a C program the does the same operations on a signed 32bit integer
>                                                      ^^ .........^^
> This is redundant. There is only unsigned and int.

Wrong. "integer" is not the same as "int". The C standard knows five
standard signed integer types and six standard unsigned integer types.
And "int" and "unsigned" are just abbreviations of "signed int" and
"unsigned int", respectively.

	hp



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

Date: Thu, 20 May 2010 14:58:58 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: bit-twiddling on 32-bit machines
Message-Id: <slrnhvajhh.bc5.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-05-19, Ben Morrow <ben@morrow.me.uk> wrote:
> Can you give an example of things not behaving as expected?

I was presuming that such things happens left and right, so I did not
try to remember the problems people were reporting.  But I may try to guess...

And: I do not have Perl with 64-bit IV AND 64-bit NV around, so all
this is just a conjecture: I expect the the following things to break:

    rounding by int($n + 0.t);
    $x + 0.5 >= $x

etc...  (These are just the first things which come to my mind; real
problems are usually less "obvious"...)

>> This thread is one example of the "first category" - if one forgets
>> what happens with `use integer', which is obviously a bug (BTW, is it
>> reported yet?).
>
> Not by me. With a perl with 32bit IVs I get
>
>     ~% perl -E'
>         my $x = (1<<30);    say $x;
>         $x <<= 1;           say $x;
>         $x <<= 1;           say $x;'
>     1073741824
>     -2147483648
>     0
>
> I presume it's the final '0' you consider a bug, not the negative value?

For bitwise operations, the negative value "behaves the same" as the
positive one, right?  (At least it WAS the reason why I designed the
Perl "numeric system" the way it is...)  Then I have no problem with
the negative number.  And I definitely have no problem with 0.

I was under assumption that the OP's problem was that shifts were
propagating to floats, and the results (above UV_MAX) converted to
UVs were becoming UV_MAX...  But maybe I misread what he wrote...

Yours,
Ilya


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

Date: Wed, 19 May 2010 22:38:32 -0700
From: Steve M <stevem_clipthis_@clubtrout.com>
Subject: Re: Debugging question: tracing the origin of an error.
Message-Id: <804Jn.9696$yx.1587@newsfe13.iad>

On 5/13/2010 10:10 AM, Ted Byers wrote:
> I have done all the usual things (as specified in the FAQ), and more,
> but it isn't enough.
>
> Here is how my script starts:
>
> use strict;
> use warnings;
> use DBI;
> use DateTime::Format::MySQL;
> use Date::Manip;
> use DateTime::Format::DateManip;
>

<snip>

>
> At no time have I made direct use of the file mentioned, so it must be
> something one of the above packages has done.

Well. Maybe. At least indirectly. Win32::TieRegistry is being called by 
something else, and I'm wondering.....

I've done a little digging, and one article I ran across said that DBI 
worked fine with Sybase and an older Oracle, but a *newer* copy of 
Oracle gave the error message you are getting.

Hmmm...... I definitely getting the impression it may be a driver issue 
of some kind...

Probably wrong, but I'd certainly look into it. Maybe even try a clean 
install of Strawberry Perl. (I recommend it because though I've used 
Activestate for years it recently annoyed me for the last time. :-)

Ah.. if you do install Strawberry, more than likely you'll want to check 
your paths if 'things' don't work out of the box. On my 'Doze machine, I 
had to fiddle the path to Perl.

hth,

\s

-- 
"There is no use in your walking five miles to fish when you can depend 
on being just as unsuccessful near home." M. Twain


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

Date: Thu, 20 May 2010 13:27:29 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Debugging question: tracing the origin of an error.
Message-Id: <hemfc7-0bf.ln1@osiris.mauzo.dyndns.org>


Quoth Ted Byers <r.ted.byers@gmail.com>:
> On May 19, 6:54 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > Quoth Ted Byers <r.ted.by...@gmail.com>:
> >
> > > Trace:
> > > k:/Projects/NewRiskModel/Simple.Risk.Model.pl, (eval), k:/Projects/
> > > NewRiskModel/Simple.Risk.Model.pl, Win32::TieRegistry::DESTROY, C:/
> > > Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
> > > (eval), C:/Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
> >
> > > Can't call method "FETCH" on an undefined value at C:/Perl/site/lib/
> > > Win32/TieRegistry.pm line 1485, &#60;DATA&#62; line 335 during global
> > > destruction.
> >
> > > Compilation finished at Wed May 19 16:41:23
> >
> > Am I correct that line 1485 of your copy of Win32/TieRegistry.pm is the
> > last line here?
> >
> >     sub DESTROY
> >     {
> >         my $self= shift(@_);
> >         return   if  tied(%$self);
> >         my $unload;
> >         eval { $unload= $self->{UNLOADME}; 1 }
> >
> > If so I can't see how that could be calling tie magic, since the code's
> > just checked that it *isn't* tied. In any case, back up your copy of
> > Win32/TieRegistry.pm and add
> >
> >     use Devel::Peek ();
> >     use Carp ();
> >     Devel::Peek::Dump($self);
> >     Carp::confess("huh?");
> >
> > just before that line, and post the result.
> 
> I hadn't noticed that, but I was out of my depth as I have never used
> the tie magic, and didn't know which of the packages I used would or
> why.
> 
> In any event, here is the output after adding the four lines you
> suggest:
> 
<snip>
> SV = RV(0x22c15b0) at 0x22c15a4
>   REFCNT = 1
>   FLAGS = (PADMY,ROK)
>   RV = 0x1c53074
>   SV = PVHV(0x1e45c4c) at 0x1c53074
>     REFCNT = 2
>     FLAGS = (OBJECT,SHAREKEYS)
>     STASH = 0x1f5b01c	"Win32::TieRegistry"
>     ARRAY = 0x222f58c  (0:14, 1:14, 2:4)
>     hash quality = 121.5%
>     KEYS = 22
>     FILL = 18
>     MAX = 31
>     RITER = -1
>     EITER = 0x0

OK, so the hash definitely isn't tied. (If it had been there would have
been a whole MAGIC section, including the line

    MG_TYPE = PERL_magic_tied(P)

 .)

Can you confirm that the code does in fact get as far as l1485, and
doesn't get any further? (Take out the 'confess', and put a 'warn'
before 'eval { $unload=...' and another before 'my $debug=...'.)

If it does, then the only remaining option is that $self->{UNLOADME}
*is* tied, and that the tied object is getting destroyed before its
parent. You can confirm this by changing the Devel::Peek::Dump line you
added before to

    Devel::Peek::Dump($self->{UNLOADME});

If that output includes the MAGIC line I mentioned above, post it.

Ben



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

Date: Thu, 20 May 2010 07:32:40 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Debugging question: tracing the origin of an error.
Message-Id: <a58d5eb7-cb5e-4791-931e-d6d9a7415c89@m21g2000vbr.googlegroups.com>

On May 20, 8:27=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Ted Byers <r.ted.by...@gmail.com>:
>
>
>
> > On May 19, 6:54=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth Ted Byers <r.ted.by...@gmail.com>:
>
> > > > Trace:
> > > > k:/Projects/NewRiskModel/Simple.Risk.Model.pl, (eval), k:/Projects/
> > > > NewRiskModel/Simple.Risk.Model.pl, Win32::TieRegistry::DESTROY, C:/
> > > > Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
> > > > (eval), C:/Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
>
> > > > Can't call method "FETCH" on an undefined value at C:/Perl/site/lib=
/
> > > > Win32/TieRegistry.pm line 1485, &#60;DATA&#62; line 335 during glob=
al
> > > > destruction.
>
> > > > Compilation finished at Wed May 19 16:41:23
>
> > > Am I correct that line 1485 of your copy of Win32/TieRegistry.pm is t=
he
> > > last line here?
>
> > > =A0 =A0 sub DESTROY
> > > =A0 =A0 {
> > > =A0 =A0 =A0 =A0 my $self=3D shift(@_);
> > > =A0 =A0 =A0 =A0 return =A0 if =A0tied(%$self);
> > > =A0 =A0 =A0 =A0 my $unload;
> > > =A0 =A0 =A0 =A0 eval { $unload=3D $self->{UNLOADME}; 1 }
>
> > > If so I can't see how that could be calling tie magic, since the code=
's
> > > just checked that it *isn't* tied. In any case, back up your copy of
> > > Win32/TieRegistry.pm and add
>
> > > =A0 =A0 use Devel::Peek ();
> > > =A0 =A0 use Carp ();
> > > =A0 =A0 Devel::Peek::Dump($self);
> > > =A0 =A0 Carp::confess("huh?");
>
> > > just before that line, and post the result.
>
> > I hadn't noticed that, but I was out of my depth as I have never used
> > the tie magic, and didn't know which of the packages I used would or
> > why.
>
> > In any event, here is the output after adding the four lines you
> > suggest:
>
> <snip>
> > SV =3D RV(0x22c15b0) at 0x22c15a4
> > =A0 REFCNT =3D 1
> > =A0 FLAGS =3D (PADMY,ROK)
> > =A0 RV =3D 0x1c53074
> > =A0 SV =3D PVHV(0x1e45c4c) at 0x1c53074
> > =A0 =A0 REFCNT =3D 2
> > =A0 =A0 FLAGS =3D (OBJECT,SHAREKEYS)
> > =A0 =A0 STASH =3D 0x1f5b01c =A0 =A0 =A0"Win32::TieRegistry"
> > =A0 =A0 ARRAY =3D 0x222f58c =A0(0:14, 1:14, 2:4)
> > =A0 =A0 hash quality =3D 121.5%
> > =A0 =A0 KEYS =3D 22
> > =A0 =A0 FILL =3D 18
> > =A0 =A0 MAX =3D 31
> > =A0 =A0 RITER =3D -1
> > =A0 =A0 EITER =3D 0x0
>
> OK, so the hash definitely isn't tied. (If it had been there would have
> been a whole MAGIC section, including the line
>
> =A0 =A0 MG_TYPE =3D PERL_magic_tied(P)
>
> .)
>
> Can you confirm that the code does in fact get as far as l1485, and
> doesn't get any further? (Take out the 'confess', and put a 'warn'
> before 'eval { $unload=3D...' and another before 'my $debug=3D...'.)
>
> If it does, then the only remaining option is that $self->{UNLOADME}
> *is* tied, and that the tied object is getting destroyed before its
> parent. You can confirm this by changing the Devel::Peek::Dump line you
> added before to
>
> =A0 =A0 Devel::Peek::Dump($self->{UNLOADME});
>
> If that output includes the MAGIC line I mentioned above, post it.
>
> Ben

Thanks Ben

Yes, it is confirmed that it gets to line 1485 and no further.

And changing the peek line as suggested produces the following:

SV =3D PVLV(0x185b6b4) at 0x22245bc
  REFCNT =3D 1
  FLAGS =3D (TEMP,GMG,SMG)
  IV =3D 0
  NV =3D 0
  PV =3D 0
  MAGIC =3D 0x243554c
    MG_VIRTUAL =3D &PL_vtbl_defelem
    MG_TYPE =3D PERL_MAGIC_defelem(y)
    MG_FLAGS =3D 0x02
      REFCOUNTED
    MG_OBJ =3D 0x22245cc
    SV =3D PV(0x1fa55d4) at 0x22245cc
      REFCNT =3D 1
      FLAGS =3D (POK,pPOK)
      PV =3D 0x1836474 "UNLOADME"\0
      CUR =3D 8
      LEN =3D 12
  TYPE =3D y
  TARGOFF =3D 0
  TARGLEN =3D 1
  TARG =3D 0x1bdb234
  SV =3D PVHV(0x1e45c6c) at 0x1bdb234
    REFCNT =3D 3
    FLAGS =3D (OBJECT,SHAREKEYS)
    STASH =3D 0x1f5b034	"Win32::TieRegistry"
    ARRAY =3D 0x22298cc  (0:14, 1:14, 2:4)
    hash quality =3D 121.5%
    KEYS =3D 22
    FILL =3D 18
    MAX =3D 31
    RITER =3D -1
    EITER =3D 0x0
    Elt "CntValues" HASH =3D 0x359bb702
    SV =3D IV(0x230a7a0) at 0x230a7a4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "MaxSubClassLen" HASH =3D 0xb3d551a2
    SV =3D IV(0x230a850) at 0x230a854
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "FLAGS" HASH =3D 0x1773e623
    SV =3D IV(0x230a9b0) at 0x230a9b4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 136


The "MG_TYPE =3D PERL_magic_tied(P)" isn't there.  Instead, I see
"MG_TYPE =3D PERL_MAGIC_defelem(y)"

What next?

Would this be an issue with DBI, or the MySQL driver?

Is it likely to do any harm?  The program runs fine otherwise.  I am
just troubled that this error arises after the code I wrote finishes.
And seeing the name of the package where the error occurs is
"TieRegistry", I am concerned this error may introduce, or be a
consequence of, errors in my registry.

Thanks again

Ted

Thanks again,

Ted


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

Date: Thu, 20 May 2010 07:33:07 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Debugging question: tracing the origin of an error.
Message-Id: <a5b0df6f-dddc-429f-972b-cd5f615cd9f1@p17g2000vbe.googlegroups.com>

On May 20, 8:27=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Ted Byers <r.ted.by...@gmail.com>:
>
>
>
> > On May 19, 6:54=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth Ted Byers <r.ted.by...@gmail.com>:
>
> > > > Trace:
> > > > k:/Projects/NewRiskModel/Simple.Risk.Model.pl, (eval), k:/Projects/
> > > > NewRiskModel/Simple.Risk.Model.pl, Win32::TieRegistry::DESTROY, C:/
> > > > Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
> > > > (eval), C:/Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
>
> > > > Can't call method "FETCH" on an undefined value at C:/Perl/site/lib=
/
> > > > Win32/TieRegistry.pm line 1485, &#60;DATA&#62; line 335 during glob=
al
> > > > destruction.
>
> > > > Compilation finished at Wed May 19 16:41:23
>
> > > Am I correct that line 1485 of your copy of Win32/TieRegistry.pm is t=
he
> > > last line here?
>
> > > =A0 =A0 sub DESTROY
> > > =A0 =A0 {
> > > =A0 =A0 =A0 =A0 my $self=3D shift(@_);
> > > =A0 =A0 =A0 =A0 return =A0 if =A0tied(%$self);
> > > =A0 =A0 =A0 =A0 my $unload;
> > > =A0 =A0 =A0 =A0 eval { $unload=3D $self->{UNLOADME}; 1 }
>
> > > If so I can't see how that could be calling tie magic, since the code=
's
> > > just checked that it *isn't* tied. In any case, back up your copy of
> > > Win32/TieRegistry.pm and add
>
> > > =A0 =A0 use Devel::Peek ();
> > > =A0 =A0 use Carp ();
> > > =A0 =A0 Devel::Peek::Dump($self);
> > > =A0 =A0 Carp::confess("huh?");
>
> > > just before that line, and post the result.
>
> > I hadn't noticed that, but I was out of my depth as I have never used
> > the tie magic, and didn't know which of the packages I used would or
> > why.
>
> > In any event, here is the output after adding the four lines you
> > suggest:
>
> <snip>
> > SV =3D RV(0x22c15b0) at 0x22c15a4
> > =A0 REFCNT =3D 1
> > =A0 FLAGS =3D (PADMY,ROK)
> > =A0 RV =3D 0x1c53074
> > =A0 SV =3D PVHV(0x1e45c4c) at 0x1c53074
> > =A0 =A0 REFCNT =3D 2
> > =A0 =A0 FLAGS =3D (OBJECT,SHAREKEYS)
> > =A0 =A0 STASH =3D 0x1f5b01c =A0 =A0 =A0"Win32::TieRegistry"
> > =A0 =A0 ARRAY =3D 0x222f58c =A0(0:14, 1:14, 2:4)
> > =A0 =A0 hash quality =3D 121.5%
> > =A0 =A0 KEYS =3D 22
> > =A0 =A0 FILL =3D 18
> > =A0 =A0 MAX =3D 31
> > =A0 =A0 RITER =3D -1
> > =A0 =A0 EITER =3D 0x0
>
> OK, so the hash definitely isn't tied. (If it had been there would have
> been a whole MAGIC section, including the line
>
> =A0 =A0 MG_TYPE =3D PERL_magic_tied(P)
>
> .)
>
> Can you confirm that the code does in fact get as far as l1485, and
> doesn't get any further? (Take out the 'confess', and put a 'warn'
> before 'eval { $unload=3D...' and another before 'my $debug=3D...'.)
>
> If it does, then the only remaining option is that $self->{UNLOADME}
> *is* tied, and that the tied object is getting destroyed before its
> parent. You can confirm this by changing the Devel::Peek::Dump line you
> added before to
>
> =A0 =A0 Devel::Peek::Dump($self->{UNLOADME});
>
> If that output includes the MAGIC line I mentioned above, post it.
>
> Ben

Thanks Ben

Yes, it is confirmed that it gets to line 1485 and no further.

And changing the peek line as suggested produces the following:

SV =3D PVLV(0x185b6b4) at 0x22245bc
  REFCNT =3D 1
  FLAGS =3D (TEMP,GMG,SMG)
  IV =3D 0
  NV =3D 0
  PV =3D 0
  MAGIC =3D 0x243554c
    MG_VIRTUAL =3D &PL_vtbl_defelem
    MG_TYPE =3D PERL_MAGIC_defelem(y)
    MG_FLAGS =3D 0x02
      REFCOUNTED
    MG_OBJ =3D 0x22245cc
    SV =3D PV(0x1fa55d4) at 0x22245cc
      REFCNT =3D 1
      FLAGS =3D (POK,pPOK)
      PV =3D 0x1836474 "UNLOADME"\0
      CUR =3D 8
      LEN =3D 12
  TYPE =3D y
  TARGOFF =3D 0
  TARGLEN =3D 1
  TARG =3D 0x1bdb234
  SV =3D PVHV(0x1e45c6c) at 0x1bdb234
    REFCNT =3D 3
    FLAGS =3D (OBJECT,SHAREKEYS)
    STASH =3D 0x1f5b034	"Win32::TieRegistry"
    ARRAY =3D 0x22298cc  (0:14, 1:14, 2:4)
    hash quality =3D 121.5%
    KEYS =3D 22
    FILL =3D 18
    MAX =3D 31
    RITER =3D -1
    EITER =3D 0x0
    Elt "CntValues" HASH =3D 0x359bb702
    SV =3D IV(0x230a7a0) at 0x230a7a4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "MaxSubClassLen" HASH =3D 0xb3d551a2
    SV =3D IV(0x230a850) at 0x230a854
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "FLAGS" HASH =3D 0x1773e623
    SV =3D IV(0x230a9b0) at 0x230a9b4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 136


The "MG_TYPE =3D PERL_magic_tied(P)" isn't there.  Instead, I see
"MG_TYPE =3D PERL_MAGIC_defelem(y)"

What next?

Would this be an issue with DBI, or the MySQL driver?

Is it likely to do any harm?  The program runs fine otherwise.  I am
just troubled that this error arises after the code I wrote finishes.
And seeing the name of the package where the error occurs is
"TieRegistry", I am concerned this error may introduce, or be a
consequence of, errors in my registry.

Thanks again

Ted

Thanks again,

Ted


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

Date: Thu, 20 May 2010 07:33:25 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: Debugging question: tracing the origin of an error.
Message-Id: <5655cf21-2ee8-45f8-b8e5-8264192af3b8@c11g2000vbe.googlegroups.com>

On May 20, 8:27=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Ted Byers <r.ted.by...@gmail.com>:
>
>
>
> > On May 19, 6:54=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth Ted Byers <r.ted.by...@gmail.com>:
>
> > > > Trace:
> > > > k:/Projects/NewRiskModel/Simple.Risk.Model.pl, (eval), k:/Projects/
> > > > NewRiskModel/Simple.Risk.Model.pl, Win32::TieRegistry::DESTROY, C:/
> > > > Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
> > > > (eval), C:/Perl/site/lib/Win32/TieRegistry.pm, Line: 1485
>
> > > > Can't call method "FETCH" on an undefined value at C:/Perl/site/lib=
/
> > > > Win32/TieRegistry.pm line 1485, &#60;DATA&#62; line 335 during glob=
al
> > > > destruction.
>
> > > > Compilation finished at Wed May 19 16:41:23
>
> > > Am I correct that line 1485 of your copy of Win32/TieRegistry.pm is t=
he
> > > last line here?
>
> > > =A0 =A0 sub DESTROY
> > > =A0 =A0 {
> > > =A0 =A0 =A0 =A0 my $self=3D shift(@_);
> > > =A0 =A0 =A0 =A0 return =A0 if =A0tied(%$self);
> > > =A0 =A0 =A0 =A0 my $unload;
> > > =A0 =A0 =A0 =A0 eval { $unload=3D $self->{UNLOADME}; 1 }
>
> > > If so I can't see how that could be calling tie magic, since the code=
's
> > > just checked that it *isn't* tied. In any case, back up your copy of
> > > Win32/TieRegistry.pm and add
>
> > > =A0 =A0 use Devel::Peek ();
> > > =A0 =A0 use Carp ();
> > > =A0 =A0 Devel::Peek::Dump($self);
> > > =A0 =A0 Carp::confess("huh?");
>
> > > just before that line, and post the result.
>
> > I hadn't noticed that, but I was out of my depth as I have never used
> > the tie magic, and didn't know which of the packages I used would or
> > why.
>
> > In any event, here is the output after adding the four lines you
> > suggest:
>
> <snip>
> > SV =3D RV(0x22c15b0) at 0x22c15a4
> > =A0 REFCNT =3D 1
> > =A0 FLAGS =3D (PADMY,ROK)
> > =A0 RV =3D 0x1c53074
> > =A0 SV =3D PVHV(0x1e45c4c) at 0x1c53074
> > =A0 =A0 REFCNT =3D 2
> > =A0 =A0 FLAGS =3D (OBJECT,SHAREKEYS)
> > =A0 =A0 STASH =3D 0x1f5b01c =A0 =A0 =A0"Win32::TieRegistry"
> > =A0 =A0 ARRAY =3D 0x222f58c =A0(0:14, 1:14, 2:4)
> > =A0 =A0 hash quality =3D 121.5%
> > =A0 =A0 KEYS =3D 22
> > =A0 =A0 FILL =3D 18
> > =A0 =A0 MAX =3D 31
> > =A0 =A0 RITER =3D -1
> > =A0 =A0 EITER =3D 0x0
>
> OK, so the hash definitely isn't tied. (If it had been there would have
> been a whole MAGIC section, including the line
>
> =A0 =A0 MG_TYPE =3D PERL_magic_tied(P)
>
> .)
>
> Can you confirm that the code does in fact get as far as l1485, and
> doesn't get any further? (Take out the 'confess', and put a 'warn'
> before 'eval { $unload=3D...' and another before 'my $debug=3D...'.)
>
> If it does, then the only remaining option is that $self->{UNLOADME}
> *is* tied, and that the tied object is getting destroyed before its
> parent. You can confirm this by changing the Devel::Peek::Dump line you
> added before to
>
> =A0 =A0 Devel::Peek::Dump($self->{UNLOADME});
>
> If that output includes the MAGIC line I mentioned above, post it.
>
> Ben

Thanks Ben

Yes, it is confirmed that it gets to line 1485 and no further.

And changing the peek line as suggested produces the following:

SV =3D PVLV(0x185b6b4) at 0x22245bc
  REFCNT =3D 1
  FLAGS =3D (TEMP,GMG,SMG)
  IV =3D 0
  NV =3D 0
  PV =3D 0
  MAGIC =3D 0x243554c
    MG_VIRTUAL =3D &PL_vtbl_defelem
    MG_TYPE =3D PERL_MAGIC_defelem(y)
    MG_FLAGS =3D 0x02
      REFCOUNTED
    MG_OBJ =3D 0x22245cc
    SV =3D PV(0x1fa55d4) at 0x22245cc
      REFCNT =3D 1
      FLAGS =3D (POK,pPOK)
      PV =3D 0x1836474 "UNLOADME"\0
      CUR =3D 8
      LEN =3D 12
  TYPE =3D y
  TARGOFF =3D 0
  TARGLEN =3D 1
  TARG =3D 0x1bdb234
  SV =3D PVHV(0x1e45c6c) at 0x1bdb234
    REFCNT =3D 3
    FLAGS =3D (OBJECT,SHAREKEYS)
    STASH =3D 0x1f5b034	"Win32::TieRegistry"
    ARRAY =3D 0x22298cc  (0:14, 1:14, 2:4)
    hash quality =3D 121.5%
    KEYS =3D 22
    FILL =3D 18
    MAX =3D 31
    RITER =3D -1
    EITER =3D 0x0
    Elt "CntValues" HASH =3D 0x359bb702
    SV =3D IV(0x230a7a0) at 0x230a7a4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "MaxSubClassLen" HASH =3D 0xb3d551a2
    SV =3D IV(0x230a850) at 0x230a854
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 0
    Elt "FLAGS" HASH =3D 0x1773e623
    SV =3D IV(0x230a9b0) at 0x230a9b4
      REFCNT =3D 1
      FLAGS =3D (IOK,pIOK)
      IV =3D 136


The "MG_TYPE =3D PERL_magic_tied(P)" isn't there.  Instead, I see
"MG_TYPE =3D PERL_MAGIC_defelem(y)"

What next?

Would this be an issue with DBI, or the MySQL driver?

Is it likely to do any harm?  The program runs fine otherwise.  I am
just troubled that this error arises after the code I wrote finishes.
And seeing the name of the package where the error occurs is
"TieRegistry", I am concerned this error may introduce, or be a
consequence of, errors in my registry.

Thanks again

Ted

Thanks again,

Ted


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

Date: Thu, 20 May 2010 06:24:14 -0700 (PDT)
From: David Resnick <lndresnick@gmail.com>
Subject: getting results of multiple simultaneous system commands
Message-Id: <8efe4328-b766-4e42-9072-ffac9a547394@d12g2000vbr.googlegroups.com>

I need to execute multiple simultaneous system() statements.  I
originally did this using perl threads each invoking a system cmd,
waiting for them to be joinable, then harvesting the return status
with join().  The system commands are well behaved in that they will
finish eventually (have built in time limits).  Unfortunately, I
discovered that the perl I need to use on some of our systems was
built without threads and replacing it isn't an option.

Is there a nice way to do this AND get the return values of the
processes launched in single threaded perl?  Repeated system("$cmd &")
would execute all the processes, but I would need some way to get the
return status.  Fork and exec would also work, but same issue.  I
could run a wrapper that calls system and writes the result to a file
I guess, but that feels clunky.  Any suggestions that seem nicer?



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

Date: Thu, 20 May 2010 16:00:06 +0200
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: getting results of multiple simultaneous system commands
Message-Id: <4bf54067$0$22941$e4fe514c@news.xs4all.nl>

David Resnick wrote:

> I need to execute multiple simultaneous system() statements.

push @exit, system("$_ &") for @command;


> [...]  Unfortunately, I
> discovered that the perl I need to use on some of our systems was
> built without threads and replacing it isn't an option.

Consider it a blessing. Just fork and wait.

-- 
Ruud


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

Date: Thu, 20 May 2010 11:56:47 +0300
From: John <John.Smith@invalid.com>
Subject: How do I check if www site has Perl compatible?
Message-Id: <ugs9v5da85geiklfuah7b1miepdq3u0b9n@4ax.com>

Is there a way to check if a www site is Perl compatible without username &
password?

I sometimes get request to do some small perl problem on a www page but the owner
does not know if their www has perl.


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

Date: Thu, 20 May 2010 11:17:46 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: How do I check if www site has Perl compatible?
Message-Id: <87mxvv0w5h.fsf@vps1.hacking.dk>

John <John.Smith@invalid.com> writes:

> Is there a way to check if a www site is Perl compatible without username &
> password?

How do you define "a www site is Perl compatible"?

//Makholm


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

Date: Thu, 20 May 2010 10:53:29 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: How do I check if www site has Perl compatible?
Message-Id: <4bf5069c$0$2525$da0feed9@news.zen.co.uk>

On 20/05/2010 09:56, John wrote:
> Is there a way to check if a www site is Perl compatible without username&
> password?

I find your question hard to understand!

Are you asking how to determine if a server, which hosts a web-site, has 
perl available?

If the server is provided by a hosting comany you can inspect their 
sales or support information or ask their support staff.

If it is a Unix or Linux server, which you can often tell from the HTTP 
headers it returns, it most likely has perl.

If you have shell access you can verify this by attempting to invoke perl.

If you have file-upload access to a CGI folder/directory and to the 
HTTP-server's error logs, you can upload perl scripts with various 
shebang lines and see what sort of errors are logged.



> I sometimes get request to do some small perl problem on a www page but the owner
> does not know if their www has perl.

I find this hard to understand. If the owner has a perl problem don't 
they have perl by definition? Unless the problem is that they don't in 
which case your question is self answering.

Are you saying that the owner asked you to help with a problem, for 
which you decided perl could be used to provide (part of) a solution?

-- 
RGB


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

Date: Thu, 20 May 2010 14:53:11 +0300
From: John <John.Smith@invalid.com>
Subject: Re: How do I check if www site has Perl compatible?
Message-Id: <268av5dmquv9bks2vk8gie4q8rc740mrij@4ax.com>

RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote:

>On 20/05/2010 09:56, John wrote:
>> Is there a way to check if a www site is Perl compatible without username&
>> password?
>
>I find your question hard to understand!
>
>Are you asking how to determine if a server, which hosts a web-site, has 
>perl available?
>
>If the server is provided by a hosting comany you can inspect their 
>sales or support information or ask their support staff.
>
>If it is a Unix or Linux server, which you can often tell from the HTTP 
>headers it returns, it most likely has perl.
>
>If you have shell access you can verify this by attempting to invoke perl.
>
>If you have file-upload access to a CGI folder/directory and to the 
>HTTP-server's error logs, you can upload perl scripts with various 
>shebang lines and see what sort of errors are logged.
>
>
>
>> I sometimes get request to do some small perl problem on a www page but the owner
>> does not know if their www has perl.
>
>I find this hard to understand. If the owner has a perl problem don't 
>they have perl by definition? Unless the problem is that they don't in 
>which case your question is self answering.
>
>Are you saying that the owner asked you to help with a problem, for 
>which you decided perl could be used to provide (part of) a solution?


Sorry about the type "problem" should have been "program".

Let me clarify what I mean. Lets say client likes my counter.pl which runs on my
own www page. He calls be and says "I'd like to have your counter on my own www
site?". To which I answer: "Sure. Can you run perl scripts on your www page?". At
this point the client answers "Huh? What's a script and what is perl?".
Usually I ask the client to send me his/her ftp username & password so I can
check out myself. Unfortunately many don't know them. They can of course find
them by contacting their provider etc. Without going to lot of work on finding
out in the end that they can only run ASP my  question is that is there a way to
find out if they can run perl on their site somehow?


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

Date: Thu, 20 May 2010 13:32:23 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How do I check if www site has Perl compatible?
Message-Id: <nnmfc7-0bf.ln1@osiris.mauzo.dyndns.org>


Quoth John.Smith@invalid.com:
> 
> Sorry about the type "problem" should have been "program".
> 
> Let me clarify what I mean. Lets say client likes my counter.pl which runs on my
> own www page. He calls be and says "I'd like to have your counter on my own www
> site?". To which I answer: "Sure. Can you run perl scripts on your www
> page?". At
> this point the client answers "Huh? What's a script and what is perl?".
> Usually I ask the client to send me his/her ftp username & password so I can
> check out myself. Unfortunately many don't know them. They can of course find
> them by contacting their provider etc. Without going to lot of work on finding
> out in the end that they can only run ASP my  question is that is there a way to
> find out if they can run perl on their site somehow?

As RGB said, about the only thing you can do is check the headers. If
there's a header like

    Server: Apache/2.2.14 (Unix) mod_perl/2.0.4

then they probably do support perl (the important bit there is the
'mod_perl', btw). If not, then they *still* probably do support perl
(most hosting providers do, in some form, though the support is often
rather minimal) but you can't tell without asking them.

Ben



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

Date: Thu, 20 May 2010 07:20:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How do I check if www site has Perl compatible?
Message-Id: <86sk5mk635.fsf@red.stonehenge.com>

>>>>> "John" == John  <John.Smith@invalid.com> writes:

John> They can of course find them by contacting their provider etc.

And that is the only real way to know.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Thu, 20 May 2010 06:02:30 -0700 (PDT)
From: "christoph.rabel@gmail.com" <christoph.rabel@gmail.com>
Subject: How to avoid zombies?
Message-Id: <30b7b999-9408-46e1-99bf-f747507a4300@o39g2000vbd.googlegroups.com>

Hi!
I have inherited a server application which was moved to Linux a
couple of weeks ago. Now we see a lot of defunct processes in the
process list.

Essentially we spawn a new thread for each client. communicate "talks"
a while with it and closes the connection afterwards. As it seems, the
spawned processes end up as zombies. Can I avoid this behavior easily?
Or is ignoring it the best approach?

Here is some code to illustrate our approach:
 (I simplified it slightly, removed some error checking)
while (($paddr = accept(CLIENT, SERVER)) || !$time_to_die) {
        if ($paddr) {
            my ($port, $iaddr) = sockaddr_in($paddr);
            my $name = gethostbyaddr($iaddr, AF_INET);
            my $ip = inet_ntoa($iaddr);
            logMsg(2, $ip . "(" . $name . "):" . $port . "
connected");
                spawn (sub {
                        communicate($ip, $port);
                });
        }
    }



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

Date: Thu, 20 May 2010 07:22:17 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: "christoph.rabel\@gmail.com" <christoph.rabel@gmail.com>
Subject: Re: How to avoid zombies?
Message-Id: <86ocgak606.fsf@red.stonehenge.com>

>>>>> "christoph" == christoph rabel@gmail com <christoph.rabel@gmail.com> writes:

christoph> I have inherited a server application which was moved to Linux a
christoph> couple of weeks ago. Now we see a lot of defunct processes in the
christoph> process list.

Seriously?  You didn't think to try the most obvious word in a lookup in
the Perl FAQ?

$ perldoc -q zombie

Found in /usr/local/lib/perl5/5.10.1/pod/perlfaq8.pod
  How do I avoid zombies on a Unix system?
    Use the reaper code from "Signals" in perlipc to call wait() when a
    SIGCHLD is received, or else use the double-fork technique described in
    "How do I start a process in the background?" in perlfaq8.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Thu, 20 May 2010 07:34:46 -0700 (PDT)
From: "christoph.rabel@gmail.com" <christoph.rabel@gmail.com>
Subject: Re: How to avoid zombies?
Message-Id: <e00f8e53-5cd3-4364-b9c7-545efe3034d7@o1g2000vbe.googlegroups.com>

On May 20, 4:22=A0pm, mer...@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "christoph" =3D=3D christoph rabel@gmail com <christoph.ra...@gmail=
 .com> writes:
>
> christoph> I have inherited a server application which was moved to Linux=
 a
> christoph> couple of weeks ago. Now we see a lot of defunct processes in =
the
> christoph> process list.
>
> Seriously? =A0You didn't think to try the most obvious word in a lookup i=
n
> the Perl FAQ?

Thx. I just inherited the app, I have nothing to do with perl
otherwise, I didn't even know that "perldoc" exists.

Chris


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

Date: Thu, 20 May 2010 00:19:39 -0700 (PDT)
From: mike <mikaelpetterson@hotmail.com>
Subject: Re: ls in ftp fails
Message-Id: <6dfdf5e8-3b30-4534-8239-49a0efffe111@z33g2000vbb.googlegroups.com>

On 19 Maj, 22:06, Ohhhh maaan <nobodyh...@example.com> wrote:
> mike wrote:
> > Hi,
>
> > I connect to a remote ftp site:
>
> > I see the following from the script:
>
> > Directory is /mirror/eclipse/technology/epp/downloads/release/galileo/
> > SR2
>
> > I cannot list the files in the directory $current_dir.
>
> > The line that fails is:
>
> > my @files=$ftp -> ls("$current_dir") or die "Could not list files. $!
> > \n";
>
> Works for me, try setting PASV mode or not, because it's likely a
> firewall issue that's blocking the listing.

Thanks for all helpful pointers. I had a typo i my code. I was
supposed to be message and not $message.

//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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 2955
***************************************


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