[32432] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3699 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 25 03:09:28 2012

Date: Fri, 25 May 2012 00:09:10 -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           Fri, 25 May 2012     Volume: 11 Number: 3699

Today's topics:
    Re: DBD::Oracle build on aix 6.1 ( host is a 64 bit db  <gogala.mladen@gmail.com>
    Re: get local packages symbols with require <marc.girod@gmail.com>
    Re: get local packages symbols with require <marc.girod@gmail.com>
    Re: get local packages symbols with require <marc.girod@gmail.com>
    Re: get local packages symbols with require <hjp-usenet2@hjp.at>
    Re: get local packages symbols with require <marc.girod@gmail.com>
    Re: Help with install from CPAN (Seymour J.)
    Re: Help with install from CPAN (Seymour J.)
    Re: Objective C (OT) (Seymour J.)
    Re: Objective C (OT) <hjp-usenet2@hjp.at>
    Re: OT: How to calculate reputation scores? <ac.russell@live.com>
        Video tutorials on VIM and UNIX <yuejdesigner85@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 23 May 2012 01:54:31 +0000 (UTC)
From: Mladen Gogala <gogala.mladen@gmail.com>
Subject: Re: DBD::Oracle build on aix 6.1 ( host is a 64 bit db server )
Message-Id: <pan.2012.05.23.01.54.31@gmail.com>

On Tue, 22 May 2012 08:58:36 +0000, Heinrich Mislik wrote:

> Don't do that. Point ORACLE_HOME to the installed Oracle. Having the
> instantclient installed on an Oracle DB-server may leave you with
> incompatible versions of client libraries on that server. This can lead
> to strange errors (core dumped within Oracle library) during connect
> using ORACLE_SID.

1) Never, ever connect to Oracle using ORACLE_SID when using instant
   client. It is not built for that. It is built for Oracle*Net.
2) I have almost quarter of a century of experience with Oracle and am 
   still working as an Oracle DBA. I have never had a problem with the 
   instant client.



-- 
http://mgogala.byethost5.com


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

Date: Wed, 23 May 2012 01:09:02 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: get local packages symbols with require
Message-Id: <18b6a13b-bccc-4cd3-ad7d-70dde0c23d08@n16g2000vbn.googlegroups.com>

Hi Ben,

On May 22, 10:36=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:

> ...*why*? That's exactly what perl does when you call 'require' without
> messing about with @INC.

OK. I must be able to explain. Even for myself.
This is essential to this infrastructure, and the key word to describe
it probably 'overlay'.

The point is not to run known code, but to allow unknown modules,
mostly auto-split/loaded, to complete and redefine some functions.
These functions are made available through a shared driver (the
cleartool.plx wrapper, aliased to ct), from the command line, such as
e.g.:

ct describe
ct checkin
ct find

 ...so that the different functions may be provided by different
mixins, and some may override others. E.g. checkin can be offered by
ClearCase::Wrapper::DSB and ClearCase::Wrapper::MGi.
If you install only DSB, you get its definition. If you install both,
MGi's takes over (because of alphabetic order for the time being).

The ct wrapper should work whatever the mix of modules installed.
The modules are written independently by different authors.

So, the main wrapper implements a dispatch table, and forces the
functions to autoload as needed.

> The only effect this will have is that if the
> module you are loading loads more modules in its turn, they will have to
> be in the same directory. Is that the desired effect here? ISTM it will
> just cause problems, unless there's something funny going on you haven't
> posted yet.

In fact, there is. This part is just setting up the table. The real
meat (code) is in the *.al files, and its loading takes place from the
cleartool.plx driver.

There is in fact little code that would not be autosplit/loaded, and
it may well be that until now, it could not 'use' other modules. There
has however always been a 'use strict', which I have never seen to
affect in any way...
Something, though: some data, and function aliases.
And I have been able to place there some small routines, shared by
different autoload files.

I'd wish to be able to put more.

> (It's not quite clear to me yet how much of this you wrote, and how much
> is someone else's code you're trying to improve.

2% and 98%. My part is growing, but started from 0% 5 years ago.

> If you didn't, can you see anything elsewhere in
> the code to suggest why this was done? Do you have any VCS logs you can
> look through?)

Sure.

> The second is that overriding builtins like exit and exec is quite
> different from overriding functions. Which are you trying to do, or are
> you trying to both?

Both. As explained above, allowing to redefine functions is important
too, although the ordering makes it so that the first holds. The
others can be ignored.

> OK. Basically, you would want something like

Thanks. Will be useful.

Marc


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

Date: Wed, 23 May 2012 02:30:49 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: get local packages symbols with require
Message-Id: <0e133d91-b0ae-49ff-bdb1-58b250f90f86@b26g2000vbt.googlegroups.com>

Hi,

On May 22, 8:55=A0pm, Marc Girod <marc.gi...@gmail.com> wrote:

> Using B instead trades off only functions which would be loaded from C
> libraries, right?

I tried this in my code, after a clean require:

for my $subdir (qw(ClearCase/Wrapper)) {
    for my $dir (@INC) {
	my @pms =3D sort glob("$dir/$subdir/*.pm");
	for my $pm (@pms) {
	    $pm =3D~ s%^$dir/(.*)\.pm$%$1%;
	    (my $pkg =3D $pm) =3D~ s%[/\\]+%::%g;
	    {
		eval {
		    eval "require $pkg";
		    warn $@ if $@;
		};
		next if $@;
		my $ix =3D "auto/$pm/autosplit.ix";
		if (-e "$dir/$ix") {
		    eval { require $ix };
		    warn $@ if $@;
		}
	    }
	    my %names =3D %{"${pkg}::"};
	    for (keys %names) {
	        my $coderef =3D \&$_;
	        ref $coderef or next;
	        my $cv =3D B::svref_2object($coderef);
		$cv->isa('B::CV') or next;
		$cv->GV->isa('B::SPECIAL') and next;
		my $p=3D$cv->GV->STASH->NAME;
		next unless $p eq $pkg;
 ...

Now, under the debugger, this gives, positioned on the last line:

  DB<4> x $pkg, $dir, $subdir, scalar keys %names
0  'ClearCase::Wrapper::MGi'
1  '/home/emagiro/perl/lib/perl5'
2  'ClearCase/Wrapper'
3  105
  DB<8> p $_
annotate
  DB<9> x $p, $pkg
0  'ClearCase::Wrapper'
1  'ClearCase::Wrapper::MGi'
  DB<10> x @pms
0  'ClearCase/Wrapper/MGi'

Yet, the function 'annotate' is only defined in
ClearCase::Wrapper::MGi.
Now, it gets assigned (wrongly) to ClearCase::Wrapper.

So... I hope I am progressing, but I am not home yet.

Thanks,
Marc


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

Date: Wed, 23 May 2012 02:58:38 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: get local packages symbols with require
Message-Id: <dd3b1356-8e50-4a9a-ad3b-200d7b7c4b9c@e20g2000vbm.googlegroups.com>

On May 23, 10:30=A0am, Marc Girod <marc.gi...@gmail.com> wrote:

> So... I hope I am progressing, but I am not home yet.

I progress reading Dave's original code.
He was 10 years ago ahead of me now.
Now, he had the following:

		my $tglob =3D "${pkg}::$_";
 ...
		if ($] >=3D 5.006) {
		    next unless eval { exists &{$tglob} };
		}

which shows me my error.
I keep the B code:

	        my $coderef =3D \&{$tglob};
	        ref $coderef or next;
	        my $cv =3D B::svref_2object($coderef);
		$cv->isa('B::CV') or next;
		$cv->GV->isa('B::SPECIAL') and next;
		my $p=3D$cv->GV->STASH->NAME;
		next unless $p eq $pkg;

And this works fine on various symbols:

  DB<16> x $tglob
0  'ClearCase::Wrapper::MGi::find'
 ...
  DB<19> x $cv->GV->STASH->NAME
0  'File::Find'

  DB<22> $tglob =3D 'ClearCase::Wrapper::MGi::annotate'
 ...
  DB<27> x $cv->GV->STASH->NAME
0  'ClearCase::Wrapper::MGi'

At least the smoke test is through... even on the command line:

ClearCase-Wrapper-MGi> wrapdebug lsgen -d 0 -a MGi.pm
MGi.pm@@/main/lx/18 (MG, MG_4.106)
ClearCase-Wrapper-MGi> ct lsgen -d 0 -a MGi.pm
MGi.pm@@/main/lx/18 (MG, MG_4.106)
ClearCase-Wrapper-MGi> wrapdebug find . -name MGi.pm -print
 ./MGi.pm@@

Marc


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

Date: Thu, 24 May 2012 13:52:43 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: get local packages symbols with require
Message-Id: <slrnjrs88b.bdt.hjp-usenet2@hrunkner.hjp.at>

On 2012-05-23 08:09, Marc Girod <marc.girod@gmail.com> wrote:
> On May 22, 10:36 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>> The only effect this will have is that if the
>> module you are loading loads more modules in its turn, they will have to
>> be in the same directory. Is that the desired effect here? ISTM it will
>> just cause problems, unless there's something funny going on you haven't
>> posted yet.
>
> In fact, there is. This part is just setting up the table. The real
> meat (code) is in the *.al files, and its loading takes place from the
> cleartool.plx driver.
>
> There is in fact little code that would not be autosplit/loaded, and
> it may well be that until now, it could not 'use' other modules. There
> has however always been a 'use strict', which I have never seen to
> affect in any way...

Use loads each module only once. Presumably your scripts all start with
"use strict", so strict is loaded long before you mess with @INC. All
modules loaded after that see that strict is already loaded and don't
care where it came from.

	hp

-- 
   _  | Peter J. Holzer    | Deprecating human carelessness and
|_|_) | Sysadmin WSR       | ignorance has no successful track record.
| |   | hjp@hjp.at         | 
__/   | http://www.hjp.at/ |  -- Bill Code on asrg@irtf.org


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

Date: Thu, 24 May 2012 06:11:28 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: get local packages symbols with require
Message-Id: <bf1ac6c1-97f7-4c0c-851e-2baef484605e@m10g2000vbn.googlegroups.com>

On May 24, 12:52=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:

> Use loads each module only once. Presumably your scripts all start with
> "use strict", so strict is loaded long before you mess with @INC. All
> modules loaded after that see that strict is already loaded and don't
> care where it came from.

Good point.
What this shows (confirms) is that backwards compatibility is probably
easier to achieve than I thought: no module has even been able to load
anything, except from the autosplit functions.

Marc


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

Date: Mon, 21 May 2012 18:19:34 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Help with install from CPAN
Message-Id: <4fbabf76$4$fuzhry+tra$mr2ice@news.patriot.net>

In <fV45K0OBJxbE-pn2-vlLdewbMVVxb@localhost>, on 05/21/2012
   at 10:07 AM, "Dave Saville" <dave@invalid.invalid> said:

>Finally decided to have another go wirh 5.14.2 on OS/2.

See <http://mantis.smedley.id.au/view.php?id=515>. In particular,
there is an update from Steven Levine that seems to explain the
truncation issue:

  I suspect the issue is the significant rewrite to S_incpush in
  perl.c.  Near line 4432 we have

    libdir = newSVpvn(PERLLIB_MANGLE(dir, len), len);

  If I am reading the code right, this will do the substitution and
  create a new string chopping it off at the old length.  What I
  don't understand is why 5.10.0 and older versions seem to work
  correctly since the code is similar.

  What I suspect will correct the behavior is something like

    const char *dir2 = PERLLIB_MANGLE(dir, len);
    libdir = newSVpvn(dir2, strlen(dir2));

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Tue, 22 May 2012 23:55:48 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Help with install from CPAN
Message-Id: <4fbc5fc4$7$fuzhry+tra$mr2ice@news.patriot.net>

In <30qs89-oj22.ln1@anubis.morrow.me.uk>, on 05/22/2012
   at 05:03 PM, Ben Morrow <ben@morrow.me.uk> said:

>I suspect at this point that either your perl binaries or your EMX

I believe that's replaced by knix.

>(I don't know what the right
>shell is under OS/2, but I understand it isn't cmd.exe)?

It's still \OS2\CMD.EXE unless you're using 4OS2.

>perl -E"say system q!perl -e1! for 1..3"

Using 5.10.0 I get three lines of 0.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Wed, 23 May 2012 00:06:06 -0400
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Objective C (OT)
Message-Id: <4fbc622e$8$fuzhry+tra$mr2ice@news.patriot.net>

In <slrnjrnt6v.n13.hjp-usenet2@hrunkner.hjp.at>, on 05/22/2012
   at 10:19 PM, "Peter J. Holzer" <hjp-usenet2@hjp.at> said:

>The context was "learning C".

The claims made in that context were "Getting a decent sense of what
is actually being executed at the machine code level is important,
even if you don't intend to write at that level in practice." and, in
response to "Learning C will not give you a sense of what is actually
being executed at the machine code level.", "Counter example: it did
for me." 

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: Thu, 24 May 2012 13:43:42 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Objective C (OT)
Message-Id: <slrnjrs7ne.bdt.hjp-usenet2@hrunkner.hjp.at>

On 2012-05-23 04:06, Shmuel Metz <spamtrap@library.lspace.org.invalid> wrote:
> In <slrnjrnt6v.n13.hjp-usenet2@hrunkner.hjp.at>, on 05/22/2012
>    at 10:19 PM, "Peter J. Holzer" <hjp-usenet2@hjp.at> said:
>
>>The context was "learning C".
>
> The claims made in that context were "Getting a decent sense of what
> is actually being executed at the machine code level is important,
> even if you don't intend to write at that level in practice." and, in
> response to "Learning C will not give you a sense of what is actually
               ^^^^^^^^^^
Here it is.

> being executed at the machine code level.", "Counter example: it did
> for me." 

And yes, it did for me, too. 

	hp

-- 
   _  | Peter J. Holzer    | Deprecating human carelessness and
|_|_) | Sysadmin WSR       | ignorance has no successful track record.
| |   | hjp@hjp.at         | 
__/   | http://www.hjp.at/ |  -- Bill Code on asrg@irtf.org


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

Date: Wed, 23 May 2012 11:05:03 -0400
From: Adam Russell <ac.russell@live.com>
Subject: Re: OT: How to calculate reputation scores?
Message-Id: <21ece$4fbcfca5$813f0835$4712@news.eurofeeds.com>

On 5/22/12 12:54 PM, Mike wrote:
> A general question, not PERL releated:
>
> Many web sites have an article/message/user reputation based on the up or
> down votes the article/message/user receives. How is a reputation score
> calculated given only up and down votes? (The user is not presented with
> a 1 to 5 scale for scoring something.)
Generally it is just a net score. The score is just incremented and 
decremented
as each positive/negative vote is submitted. Some sites such as
www.perlmonks.org (let's try to get this back On Topic! :) ) use a
more elaborate algorithm though.
http://www.perlmonks.net/?node=Voting%2FExperience%20System explains
how perlmonks "Experience Points" are calculated.
So, there really is no one way and you may want to build something sort
of fun like perlmonks XP to help build a certain "community".



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

Date: Wed, 23 May 2012 20:19:07 -0700 (PDT)
From: Yue Jiang <yuejdesigner85@gmail.com>
Subject: Video tutorials on VIM and UNIX
Message-Id: <926b1917-4ea8-406d-932f-aa316d6baa49@googlegroups.com>

Hey guys, check out my video tutorials on VIM editor and UNIX at www.fuzicast.com. Let me know if you like it, thanks!


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

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


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