[32849] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4115 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 14 09:09:36 2014

Date: Tue, 14 Jan 2014 06:09:06 -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           Tue, 14 Jan 2014     Volume: 11 Number: 4115

Today's topics:
    Re: Help with understanding references to subroutines <cwilbur@chromatico.net>
        Logical or assignment and array <adrien.barreau@live.fr>
    Re: Logical or assignment and array <gravitalsun@foo.com>
    Re: Logical or assignment and array <ben@morrow.me.uk>
        no nonsense builders silicone <rutland@walters.org>
    Re: no nonsense builders silicone <jurgenex@hotmail.com>
        purge line <gravitalsun@foo.com>
    Re: purge line <gravitalsun@foo.com>
    Re: purge line <peter@makholm.net>
    Re: purge line <gravitalsun@foo.com>
    Re: purge line <peter@makholm.net>
    Re: purge line <gravitalsun@foo.com>
    Re: Question about language setting [OT] <rweikusat@mobileactivedefense.com>
    Re: Question about language setting <rweikusat@mobileactivedefense.com>
    Re: Question about language setting <rweikusat@mobileactivedefense.com>
    Re: Question about language setting <ben@morrow.me.uk>
    Re: Question about language setting <rweikusat@mobileactivedefense.com>
    Re: Question about language setting <ben@morrow.me.uk>
    Re: Question about language setting <rweikusat@mobileactivedefense.com>
    Re: Question about language setting <dave@invalid.invalid>
    Re: Question about language setting <rweikusat@mobileactivedefense.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Jan 2014 15:46:39 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Help with understanding references to subroutines
Message-Id: <874n57vccw.fsf@new.chromatico.net>

>>>>> "RW" == Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:

    RW> There are

people who understand what "Do shut up" means and (self-evidently)
people who do not.

We are all well-aware of your hobbyhorse.  Kindly stop riding it in
public.

Charlton



          
        

-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Tue, 14 Jan 2014 12:01:22 +0100
From: Adrien BARREAU <adrien.barreau@live.fr>
Subject: Logical or assignment and array
Message-Id: <lb35e3$vf4$1@dont-email.me>

Hello all.


Here is a piece of code that troubles me:

=====
$ perl -e 'my @a; @a = @a || 1..3;'
$ perl -e 'my @a; @a ||= 1..3;'
Can't modify private array in logical or assignment (||=) at -e line 1, 
near "3;"
Execution of -e aborted due to compilation errors.
=====

It thought the "a operator= b" notation really was "a = a operator b", 
but it seems it is wrong.

Does anyone have some information about this?


Adrien.


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

Date: Tue, 14 Jan 2014 14:33:05 +0200
From: George Mpouras <gravitalsun@foo.com>
Subject: Re: Logical or assignment and array
Message-Id: <lb3aor$2kje$1@news.ntua.gr>

Στις 14/1/2014 13:01, ο/η Adrien BARREAU έγραψε:
> Hello all.
>
>
> Here is a piece of code that troubles me:
>
> =====
> $ perl -e 'my @a; @a = @a || 1..3;'
> $ perl -e 'my @a; @a ||= 1..3;'
> Can't modify private array in logical or assignment (||=) at -e line 1,
> near "3;"
> Execution of -e aborted due to compilation errors.
> =====
>
> It thought the "a operator= b" notation really was "a = a operator b",
> but it seems it is wrong.
>
> Does anyone have some information about this?
>
>
> Adrien.




it have to do with left/right precedence the following works


my @a;
@a = qw/a b/;
@a or @a=1..3;

$,="\n"; print @a;


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

Date: Tue, 14 Jan 2014 12:39:42 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Logical or assignment and array
Message-Id: <epnfqa-i4q1.ln1@anubis.morrow.me.uk>


Quoth Adrien BARREAU <adrien.barreau@live.fr>:
>
> Here is a piece of code that troubles me:
> 
> =====
> $ perl -e 'my @a; @a = @a || 1..3;'
> $ perl -e 'my @a; @a ||= 1..3;'
> Can't modify private array in logical or assignment (||=) at -e line 1, 
> near "3;"
> Execution of -e aborted due to compilation errors.
> =====
> 
> It thought the "a operator= b" notation really was "a = a operator b", 
> but it seems it is wrong.
> 
> Does anyone have some information about this?

In the statement

    @a = @a || 1..3;

the first '@a' is in list context and the second is in scalar context.
This means they can't be combined into a single argument to the ||=
operator. 

I think this is because if the LHS of the assignment were a list it
would be impossible to evaluate that list in both contexts without
evaluating it twice (which ||= promises not to do).

The error message is certainly rather confusing.

Ben



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

Date: Sun, 12 Jan 2014 09:49:44 +0000
From: rutland_walters <rutland@walters.org>
Subject: no nonsense builders silicone
Message-Id: <yaydnXvpArCl-E_PnZ2dnUVZ8kGdnZ2d@bt.com>

http://www.screwfix.com/p/no-nonsense-builders-silicone-clear-310ml/83710


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

Date: Sun, 12 Jan 2014 09:58:42 -0800
From: Jrgen Exner <jurgenex@hotmail.com>
Subject: Re: no nonsense builders silicone
Message-Id: <usl5d9l67v3us2geaf6mbeug1sfjqlbg3r@4ax.com>

rutland_walters <rutland@walters.org> wrote:
>http://[...]

Are you sure your name isn't Jean-Claude Mas?

jue


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

Date: Tue, 14 Jan 2014 10:54:51 +0200
From: George Mpouras <gravitalsun@foo.com>
Subject: purge line
Message-Id: <lb2tvk$1j8h$1@news.ntua.gr>

I want my line to be 5 not 5111



my $counter;
open FILE, '+<:raw', 'test.txt' or die "$!\n";

seek   FILE, 0, 0;
read ( FILE , $counter , 64 );
print $counter;

seek  FILE, 0, 0;  print FILE  1111;
seek  FILE, 0, 0;  print FILE  5;

close FILE;


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

Date: Tue, 14 Jan 2014 11:23:58 +0200
From: George Mpouras <gravitalsun@foo.com>
Subject: Re: purge line
Message-Id: <lb2vm7$1o5f$1@news.ntua.gr>

# this seems to work but probably there is something better

my $counter;
open   FILE, '+<:raw', 'test.txt' or die "$^E\n";

seek   FILE, 0, 0;
read ( FILE , $counter , 70 );
$counter=~tr/\x20//sd;

print "*$counter*";

$counter = 1111; seek FILE, 0, 0;  printf FILE "%64d", $counter;
$counter = 5   ; seek FILE, 0, 0;  printf FILE "%64d", $counter;
close FILE;


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

Date: Tue, 14 Jan 2014 10:35:36 +0100
From: Peter Makholm <peter@makholm.net>
Subject: Re: purge line
Message-Id: <87mwiyoqhj.fsf@vps1.hacking.dk>

George Mpouras <gravitalsun@foo.com> writes:

> seek  FILE, 0, 0;  print FILE  1111;
> seek  FILE, 0, 0;  print FILE  5;

If you need to truncate the file you have to do it explicitely. The
function you are looking for is called 'truncate'.

//Makholm


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

Date: Tue, 14 Jan 2014 11:44:00 +0200
From: George Mpouras <gravitalsun@foo.com>
Subject: Re: purge line
Message-Id: <lb30rp$1r1c$1@news.ntua.gr>

Στις 14/1/2014 11:35, ο/η Peter Makholm έγραψε:
> George Mpouras <gravitalsun@foo.com> writes:
>
>> seek  FILE, 0, 0;  print FILE  1111;
>> seek  FILE, 0, 0;  print FILE  5;
>
> If you need to truncate the file you have to do it explicitely. The
> function you are looking for is called 'truncate'.
>
> //Makholm
>


not truncate , but read/update


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

Date: Tue, 14 Jan 2014 12:32:25 +0100
From: Peter Makholm <peter@makholm.net>
Subject: Re: purge line
Message-Id: <87iotmol2u.fsf@vps1.hacking.dk>

George Mpouras <gravitalsun@foo.com> writes:

>> If you need to truncate the file you have to do it explicitely. The
>> function you are looking for is called 'truncate'.
>
> not truncate , but read/update

What happens if you add a 'truncate FILE, 0;' right before printing the
second number?

For me it seems to do as you require. Of course this assumes that you
only have a single value in the file and don't need to update a value in
the middle of a larger file.

If you have multiple values in the file and need to update a single
value you would either need to rewrite all values following the value
you need to change og used a fixed format where the values have a fixed
length.

//Makholm



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

Date: Tue, 14 Jan 2014 13:57:34 +0200
From: George Mpouras <gravitalsun@foo.com>
Subject: Re: purge line
Message-Id: <lb38m7$2f3e$1@news.ntua.gr>

Στις 14/1/2014 13:32, ο/η Peter Makholm έγραψε:
> George Mpouras <gravitalsun@foo.com> writes:
>
>>> If you need to truncate the file you have to do it explicitely. The
>>> function you are looking for is called 'truncate'.
>>
>> not truncate , but read/update
>
> What happens if you add a 'truncate FILE, 0;' right before printing the
> second number?
>
> For me it seems to do as you require. Of course this assumes that you
> only have a single value in the file and don't need to update a value in
> the middle of a larger file.
>
> If you have multiple values in the file and need to update a single
> value you would either need to rewrite all values following the value
> you need to change og used a fixed format where the values have a fixed
> length.
>
> //Makholm
>


i tried , do not work seem to work at multiple iterations


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

Date: Mon, 13 Jan 2014 09:50:47 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting [OT]
Message-Id: <87vbxob47c.fsf_-_@sable.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:
> Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
>> Ben Morrow <ben@morrow.me.uk> writes:
>> >
>> > Dave is using 5.16, by which point XSUBs had changed to being static
>> > symbols by default, with only the boot_Foo symbol externally visible.
>> 
>> Is there some rationale for that beyond "it breaks existing code"?
>
> Perhaps you would like to ask that question again, leaving out the
> implicit assumption that p5p are idiots?

As far as I know, the term 'idiot' ('idiotus', actually) was invented by
Cusanus to describe people he referred to as 'eigensinnig Wissende' in
German, whose main trait was supposed to be that they won't - under any
circumstances - accept anything from anyone else and who are thus bound
to progress slowly and circuitiously towards understanding the world but
who might eventually gain such understanding nevertheless.



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

Date: Sun, 12 Jan 2014 17:14:47 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting
Message-Id: <87ob3hyveg.fsf@sable.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:
> Quoth "Dave Saville" <dave@invalid.invalid>:

[...]

>     require XSLoader;
>
>     my $dll = "$ENV{PERLLIB_PREFIX}/5.16.0/OS2/auto/POSIX/POSIX.dll";
>     my $lib = DynaLoader::dl_load_file($dll, 0);
>     push(@DynaLoader::dl_librefs, $lib);
>
>     my $boot = DynaLoader::dl_find_symbol($lib, "boot_POSIX");
>     push(@DynaLoader::dl_modules, "POSIX");
>
>     my $xs = DynaLoader::dl_install_xsub(
>         "POSIX::bootstrap", $boot, $dll);
>     push(@DynaLoader::dl_shared_objects, $dll);
>
>     $xs->();
>     {   no warnings "redefine";
>         *POSIX::bootstrap = sub { };
>     }

Considering that you don't do anything with XSLoader, should this
perhaps have been

require Dynaloader;

?

Also, the 5.10.0 POSIX.whatever should have XS__setlocale, considering
that the 5.10.1 one has it.


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

Date: Sun, 12 Jan 2014 19:51:46 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting
Message-Id: <87ob3hc71p.fsf@sable.mobileactivedefense.com>

Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> Ben Morrow <ben@morrow.me.uk> writes:
>> Quoth "Dave Saville" <dave@invalid.invalid>:
>
> [...]
>
>>     require XSLoader;
>>
>>     my $dll = "$ENV{PERLLIB_PREFIX}/5.16.0/OS2/auto/POSIX/POSIX.dll";
>>     my $lib = DynaLoader::dl_load_file($dll, 0);
>>     push(@DynaLoader::dl_librefs, $lib);

[...]

> Considering that you don't do anything with XSLoader, should this
> perhaps have been
>
> require Dynaloader;
>
> ?
>
> Also, the 5.10.0 POSIX.whatever should have XS__setlocale, considering
> that the 5.10.1 one has it.

The correct name is XS_POSIX_setlocale. For the sake of completeness,
here's an executable example (Tested on Linux. Will need to be changed
on platforms which don't use .so as extension for 'dynamically loadable
library files) showing how to import just the setlocale routine into the
current package without running any of the 'module init code',

---------------
BEGIN {
    my ($path, $lib, $sym);
    
    require DynaLoader;

    # add the perl include path to the DynaLoader library path
    # so that dl_findfile will find POSIX.so
    #
    local @DynaLoader::dl_library_path = (@DynaLoader::dl_library_path, @INC);
    $path = DynaLoader::dl_findfile('auto/POSIX/POSIX.so');
    unless ($path) {
	print STDERR ("didn't find POSIX.so\n");
	return;
    }

    # load the library
    #
    $lib = DynaLoader::dl_load_file($path, 0);
    unless ($lib) {
	print STDERR ("failed to load $path\n");
	return;
    }

    # locate the setlocale interface routine
    #
    $sym = DynaLoader::dl_find_symbol($lib, 'XS_POSIX_setlocale');
    unless ($sym) {
	print STDERR ("didn't find XS_POSIX_setlocale\n");
	return;
    }

    # install it into the current package
    #
    DynaLoader::dl_install_xsub('setlocale', $sym);

    # print a 'German floating point number'
    #
    setlocale(1, 'de_DE');	# LC_ALL == 1
    printf("%f\n", 2.5);
}
---------------

It should also be noted that locally extending an existing array with
some values couldn't work in the way it is done here without being able
to access the previous incarnation of some symbol while creating a new
one.


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

Date: Sun, 12 Jan 2014 21:57:24 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Question about language setting
Message-Id: <4nfbqa-14a.ln1@anubis.morrow.me.uk>


Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> Ben Morrow <ben@morrow.me.uk> writes:
> > Quoth "Dave Saville" <dave@invalid.invalid>:
> 
> [...]
> 
> >     require XSLoader;
> >
> >     my $dll = "$ENV{PERLLIB_PREFIX}/5.16.0/OS2/auto/POSIX/POSIX.dll";
> >     my $lib = DynaLoader::dl_load_file($dll, 0);
> >     push(@DynaLoader::dl_librefs, $lib);
> >
> >     my $boot = DynaLoader::dl_find_symbol($lib, "boot_POSIX");
> >     push(@DynaLoader::dl_modules, "POSIX");
> >
> >     my $xs = DynaLoader::dl_install_xsub(
> >         "POSIX::bootstrap", $boot, $dll);
> >     push(@DynaLoader::dl_shared_objects, $dll);
> >
> >     $xs->();
> >     {   no warnings "redefine";
> >         *POSIX::bootstrap = sub { };
> >     }
> 
> Considering that you don't do anything with XSLoader, should this
> perhaps have been
> 
> require Dynaloader;
> 
> ?

No. DynaLoader.pm loads Config.pm which loads vars.pm which tickles the
bug we're trying to avoid. XSLoader.pm bootstraps the XS part of
DynaLoader without loading the .pm, since the whole point of that module
is to dynaload without loading the relatively heavy Perl part of
DynaLoader.

Of course, you could always just run

    DynaLoader::boot_DynaLoader("DynaLoader") 
        if defined &DynaLoader::boot_DynaLoader 
            && !defined &DynaLoader::dl_error;

instead, since the whole point is that DynaLoader's bootstrap is
statically linked, so we don't need to load anything to make it
available.

> Also, the 5.10.0 POSIX.whatever should have XS__setlocale, considering
> that the 5.10.1 one has it.

Dave is using 5.16, by which point XSUBs had changed to being static
symbols by default, with only the boot_Foo symbol externally visible.

Ben



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

Date: Sun, 12 Jan 2014 23:47:52 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting
Message-Id: <878uukdaon.fsf@sable.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:

[...]

>> Also, the 5.10.0 POSIX.whatever should have XS__setlocale, considering
>> that the 5.10.1 one has it.
>
> Dave is using 5.16, by which point XSUBs had changed to being static
> symbols by default, with only the boot_Foo symbol externally visible.

Is there some rationale for that beyond "it breaks existing code"?


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

Date: Mon, 13 Jan 2014 04:55:36 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Question about language setting
Message-Id: <878cqa-d0i.ln1@anubis.morrow.me.uk>


Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> Ben Morrow <ben@morrow.me.uk> writes:
> >
> > Dave is using 5.16, by which point XSUBs had changed to being static
> > symbols by default, with only the boot_Foo symbol externally visible.
> 
> Is there some rationale for that beyond "it breaks existing code"?

Perhaps you would like to ask that question again, leaving out the
implicit assumption that p5p are idiots?

Ben



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

Date: Mon, 13 Jan 2014 09:35:24 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting
Message-Id: <87zjn0b4wz.fsf@sable.mobileactivedefense.com>

Ben Morrow <ben@morrow.me.uk> writes:
> Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
>> Ben Morrow <ben@morrow.me.uk> writes:
>> >
>> > Dave is using 5.16, by which point XSUBs had changed to being static
>> > symbols by default, with only the boot_Foo symbol externally visible.
>> 
>> Is there some rationale for that beyond "it breaks existing code"?
>
> Perhaps you would like to ask that question again, leaving out the
> implicit assumption that p5p are idiots?

A comment regarding that is available below the page break as this
question is really besides the point. I assume the XSUB change had some
technical objective, ie, someone thought something could be gained in
this way. But I can't imagine what (wich may be entirely my fault). The
wording in the corresponding changes document,

The EXPORT_XSUB_SYMBOLS: keyword is likely something you will never
need.
[http://perldoc.perl.org/5.16.1/perlxs.html]

suggests that whoever wrote that didn't believe anyone actually uses
DynaLoader for anything, yet I do. Hence, the immediate effect is that I
can't use 5.16 and onwards (not exactly an immediate danger) without
either changing all the affected code or (more likely) restoring the old
behaviour.

An immediate (although weak) argument for the old behaviour which comes
to mind would be: If the XSUBs are externally visible symbols, they can
be installed on demand. Especially for large modules providing access to
'diverse facilities', eg, POSIX, this should reduce the startup time of
code using the module, may reduce the total time needed to use some
parts of the module for a given situation (if only a few symbols are
ever used) and should use somewhat less memory.

Considering that I know that not every report made to the Perl
foundation in the course of some development grant is technically
accurate -- whether this happened because the guy who wrote them didn't
understand the matter himself or banked on the fact that the people
getting the reports won't understand it I don't know -- 'malice [aka
"some political agenda"] or stupidity' might be an interesting question
on its own right, but a rather tangential one: People who subscribe to
p5p are people, hence, they're bound to make mistakes and prone to
inventing technical justifications which don't really hold water in order
to push this or that pet agenda of them, just like all other people.

But beyond this general statement ('even the wisest man is no God'),
speculations about other people's hidden motives are (IMHO) unpleasant
and useless.


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

Date: Mon, 13 Jan 2014 10:34:10 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Question about language setting
Message-Id: <fV45K0OBJxbE-pn2-lj3jOju823dg@paddington.bear.den>

On Sun, 12 Jan 2014 21:57:24 UTC, Ben Morrow <ben@morrow.me.uk> wrote:

> 
> Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
> > Ben Morrow <ben@morrow.me.uk> writes:
> > > Quoth "Dave Saville" <dave@invalid.invalid>:
> > 
> > [...]
> > 
> > >     require XSLoader;
> > >
> > >     my $dll = "$ENV{PERLLIB_PREFIX}/5.16.0/OS2/auto/POSIX/POSIX.dll";
> > >     my $lib = DynaLoader::dl_load_file($dll, 0);
> > >     push(@DynaLoader::dl_librefs, $lib);
> > >
> > >     my $boot = DynaLoader::dl_find_symbol($lib, "boot_POSIX");
> > >     push(@DynaLoader::dl_modules, "POSIX");
> > >
> > >     my $xs = DynaLoader::dl_install_xsub(
> > >         "POSIX::bootstrap", $boot, $dll);
> > >     push(@DynaLoader::dl_shared_objects, $dll);
> > >
> > >     $xs->();
> > >     {   no warnings "redefine";
> > >         *POSIX::bootstrap = sub { };
> > >     }
> > 
> > Considering that you don't do anything with XSLoader, should this
> > perhaps have been
> > 
> > require Dynaloader;
> > 
> > ?
> 
> No. DynaLoader.pm loads Config.pm which loads vars.pm which tickles the
> bug we're trying to avoid. XSLoader.pm bootstraps the XS part of
> DynaLoader without loading the .pm, since the whole point of that module
> is to dynaload without loading the relatively heavy Perl part of
> DynaLoader.
> 
> Of course, you could always just run
> 
>     DynaLoader::boot_DynaLoader("DynaLoader") 
>         if defined &DynaLoader::boot_DynaLoader 
>             && !defined &DynaLoader::dl_error;
> 
> instead, since the whole point is that DynaLoader's bootstrap is
> statically linked, so we don't need to load anything to make it
> available.
> 
> > Also, the 5.10.0 POSIX.whatever should have XS__setlocale, considering
> > that the 5.10.1 one has it.
> 
> Dave is using 5.16, by which point XSUBs had changed to being static

Yes *I* am but other users will almost certainly be using earlier 
versions. I suppose one could switch on the perl version. 

I appreciate all the help guys but I really think the simple answer is
to check the perl version for before 5.16.3 and for 2.5 ne "2.5" and 
put out a message telling them to change the locale before running the
script and quit.
-- 
Regards
Dave Saville


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

Date: Mon, 13 Jan 2014 12:57:50 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Question about language setting
Message-Id: <878uukca41.fsf@sable.mobileactivedefense.com>

Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> Ben Morrow <ben@morrow.me.uk> writes:
>> Quoth Rainer Weikusat <rweikusat@mobileactivedefense.com>:
>>> Ben Morrow <ben@morrow.me.uk> writes:
>>> >
>>> > Dave is using 5.16, by which point XSUBs had changed to being static
>>> > symbols by default, with only the boot_Foo symbol externally visible.
>>> 
>>> Is there some rationale for that beyond "it breaks existing code"?
>>
>> Perhaps you would like to ask that question again, leaving out the
>> implicit assumption that p5p are idiots?
>
> A comment regarding that is available below the page break as this
> question is really besides the point. I assume the XSUB change had some
> technical objective, ie, someone thought something could be gained in
> this way. But I can't imagine what (wich may be entirely my fault). The
> wording in the corresponding changes document,
>
> The EXPORT_XSUB_SYMBOLS: keyword is likely something you will never
> need.
> [http://perldoc.perl.org/5.16.1/perlxs.html]
>
> suggests that whoever wrote that didn't believe anyone actually uses
> DynaLoader for anything, yet I do.

I've located the corresponding p5p thread,

http://www.nntp.perl.org/group/perl.perl5.porters/2011/08/msg175781.html

but I'm still at a loss regarding what this is supposed to accomplish. A
couple of quotes from the thread and the original commit:

https://gitorious.org/chip-perl5/chip-perl5/commit/e64345f82d66a32f6da47acf482e7e6c9282b433

	This is [...] generally preferable

	the symbols are already all internal by default on Windows (and AIX)

	I doubt that many (any?) existing modules intentionally export
	XS symbols [...] It is much easier to call plain C code from a different module
	than XS code, which really should only be called through Perl.

	Exporting the C symbol corresponding to an XS sub body is a pretty bizarre
	requirement

	'perl -MGtk2 -eexit' is now twice as fast as before: 0.036s with 5.14.1,
	0.018s

"A little less than 0.02s speedup for a program which loads a seriously
large module and does nothing" doesn't seem to be much of an improvement
to me, especially considering that Gtk2 would likely be used for an
interactive application and '0.02s during startup' is irrelevant noise
for that. The idea that this "bizarre requirement" enables on demand
creation of of XSUBs instead of creating them all at once (a benchmark
on how omitting boot_ from the Gtk2 load sequence in favour of this
affects execution time would be interesting) doesn't seem to have
crossed anyone's mind and the "It is much easier to call plain C code
[...]" strongly suggests that the guy who wrote this doesn't even know
that Perl provides an API for accessing invividual XSUBs.





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

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


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