[31012] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2257 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 6 21:09:53 2009

Date: Fri, 6 Mar 2009 18:09:16 -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, 6 Mar 2009     Volume: 11 Number: 2257

Today's topics:
    Re: "system" with [ ] in filename <c7eqjyg02@sneakemail.com>
    Re: "system" with [ ] in filename <root@localhost>
    Re: "system" with [ ] in filename <brian.helterline@hp.com>
    Re: A globbing question <yakovlev@hotmail.com>
        ANN: Dao, the official 1.0 version is released <phoolimin@gmail.com>
    Re: ANN: Dao, the official 1.0 version is released skip@pobox.com
    Re: ANN: Dao, the official 1.0 version is released <tim@burlyhost.com>
    Re: ANN: Dao, the official 1.0 version is released <phoolimin@gmail.com>
    Re: ANN: Dao, the official 1.0 version is released <tim@burlyhost.com>
    Re: ANN: Dao, the official 1.0 version is released skip@pobox.com
    Re: Find Windows Compression attribute? <novastaylor@gmail.com>
    Re: Generating html page in UTF-8 dn.perl@gmail.com
        How would I send the 'space bar command' in the followi <cdalten@gmail.com>
    Re: perl as email client <tim@burlyhost.com>
    Re: Strange system() slowdown when using Inline::C tuser1@gmail.com
    Re: Strange system() slowdown when using Inline::C <No_4@dsl.pipex.com>
    Re: Strange system() slowdown when using Inline::C <ben@morrow.me.uk>
    Re: Strange system() slowdown when using Inline::C <ben@morrow.me.uk>
    Re: Strange system() slowdown when using Inline::C <ross.girshick@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 6 Mar 2009 03:47:43 -0800 (PST)
From: ilovelinux <c7eqjyg02@sneakemail.com>
Subject: Re: "system" with [ ] in filename
Message-Id: <9be428fc-8ad6-406f-84de-406cc8e08548@l16g2000yqo.googlegroups.com>

On 5 mrt, 22:16, "Richard" <root@localhost> wrote:

> In a perl script I do this:
>
> $cmd = "convert \"$source\" -resize \"160x160>\"
> \"${thumbnail_prefix}${photonr}\"";
> print "Command for shell is: ".$cmd."\n";
> system ($cmd);
>
> This works fine, as long as ${photonr} does NOT contain any square
> brackets.
> If ${photonr} turns out to be for example: IMG_8699[1].jpg then the
> resulting system command takes an incredible lpng time to complete,
> something like 5 to 10 minutes. (it does complete in the end...)
> If no [] are present, then all is done in around half a second.

The square brackets have special meaning to ImageMagick's convert. See
http://www.imagemagick.org/script/command-line-processing.php and look
for "Selecting Frames". Why this results in this incredibly long
processing time, I don't know, however.



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

Date: Fri, 6 Mar 2009 15:21:13 +0100
From: "Richard" <root@localhost>
Subject: Re: "system" with [ ] in filename
Message-Id: <49b13156$0$99130$dbd4d001@news.euronet.nl>


"ilovelinux" <c7eqjyg02@sneakemail.com> wrote in message 
news:9be428fc-8ad6-406f-84de-406cc8e08548@l16g2000yqo.googlegroups.com...
> On 5 mrt, 22:16, "Richard" <root@localhost> wrote:
>
>> In a perl script I do this:
>>
>> $cmd = "convert \"$source\" -resize \"160x160>\"
>> \"${thumbnail_prefix}${photonr}\"";
>> print "Command for shell is: ".$cmd."\n";
>> system ($cmd);
>>
>> This works fine, as long as ${photonr} does NOT contain any square
>> brackets.
>> If ${photonr} turns out to be for example: IMG_8699[1].jpg then the
>> resulting system command takes an incredible lpng time to complete,
>> something like 5 to 10 minutes. (it does complete in the end...)
>> If no [] are present, then all is done in around half a second.
>
> The square brackets have special meaning to ImageMagick's convert. 
> See
> http://www.imagemagick.org/script/command-line-processing.php and 
> look
> for "Selecting Frames". Why this results in this incredibly long
> processing time, I don't know, however.
>

Hi,
 thank you for the link. I did not know about this...

It also seems any [ ] in the filename causes IM to "glob", unfortunate 
in this case because there are over 200.000 images in the dir.

I dont want to give up the [ ] for now, I'll try a temp dir as output 
and move the file afterwards.

Thanks again.

Richard 




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

Date: Fri, 06 Mar 2009 09:44:41 -0800
From: Brian Helterline <brian.helterline@hp.com>
Subject: Re: "system" with [ ] in filename
Message-Id: <gorneb$hsq$1@usenet01.boi.hp.com>

Richard wrote:
> 
> It also seems any [ ] in the filename causes IM to "glob", unfortunate 
> in this case because there are over 200.000 images in the dir.
> 
> I dont want to give up the [ ] for now, I'll try a temp dir as output 
> and move the file afterwards.

Since you are creating the filename yourself inside the script, you can 
always create a filename without [] for IM and rename the file after it 
successfully complete.

-- 
-brian


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

Date: Fri, 6 Mar 2009 14:59:42 -0800 (PST)
From: Alex <yakovlev@hotmail.com>
Subject: Re: A globbing question
Message-Id: <0fa1e0d0-135e-41bf-8609-effd92604b1d@o11g2000yql.googlegroups.com>

On Mar 5, 1:37 pm, Jim Gibson <jimsgib...@gmail.com> wrote:
> In article
> <4df9f800-2346-459d-8990-48ec66cee...@b16g2000yqb.googlegroups.com>,
>
>
>
> Alex <yakov...@hotmail.com> wrote:
> > Hello,
>
> > I'm trying to figure out how to "glob" lists instead of the current
> > directory. For example:
>
> >   my @var = File::Glob::bsd_glob('a*');
> >   foreach my $f (@var) {print $f, "\n";}
>
> > This fragment will print all the filenames started with 'a' in the
> > current directory.
>
> > I need some function which doesn't depend on the file system. For
> > example
>
> >   my @set = ('ab', 'ac', 'bc');
> >   my @var = new_bsd_glob('a*', @set);    # <---- non-existing function
> > with additional parameter
> >   foreach my $f (@var) {print $f, "\n";}
>
> > It must work exactly as shell globbing, so it should print 'ab' and
> > 'ac'.
>
> > I suspect this "new_bsd_glob" function already exist - could you
> > please advice where it resides?
>
> Perhaps you are looking for grep:
>
> my @var = grep( /a*/, @set );
>
> See 'perldoc -f grep'
>
> --
> Jim Gibson

Jim,

No, grep doesn't work for me. I need globbing, not regexes, because
many of special pattern symbols are interpreted differently. For
example, asterisk represents any number of any symbols in globbing
(like in Unix shell), but in regexes it represents a repetition of the
previous symbol or subexpression.

The Text::Glob module does what I want.

Thanks
AY


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

Date: Fri, 6 Mar 2009 09:57:56 -0800 (PST)
From: Limin Fu <phoolimin@gmail.com>
Subject: ANN: Dao, the official 1.0 version is released
Message-Id: <a5eacfa6-6a2d-4ecf-b941-692eee7083c0@w9g2000yqa.googlegroups.com>

Hi,

This is to announce the first official release of Dao.

Dao is a simple yet powerful object-oriented programming language with
many advanced features including, soft (or optional) typing, BNF-like
macro system, regular expression, multi-dimensional numeric array,
closure, coroutine, asynchronous function call for concurrent
programming etc.  Dao provides a rich set of standard data types,
methods and libraries.  Dao is implemented as a light and efficient
virtual machine with very transparent C programming interfaces, which
make it easy to extend Dao with C/C++ or embed Dao into C/C++
programs.

There have been a lot of improvements since the last release
including: a lot of bug fixing and some broken feature fixing; several
large implementation changes to improve the structure and clarity of
the codes; and some implementation of new features.  For the details,
please have a look at: http://www.daovm.net/?page=dao_whats_new.

Besides the improvements to the language and its implementation, the
modules, tools, documentations and website associated with this
language have also been improved greatly.  The documentations are more
complete than before, and are prepared in nice formats for easy
referencing.  A number of demos are also included in the release,
including some programs for the The Computer Language Benchmarks Game,
which can be tried out just for fun.

One automatic tool (tools/autobind.dao) was developed using Dao
itself, and was used to create most of the released Dao extending
modules, by generating wrappers directly from the header files of the
corresponding C/C++ libraries.  This tool could also be used to wrap
other C/C++ library as necessary.

A new website that was developed using Dao itself too, has been setup
at http://www.daovm.net, and is going to be the new official website
of Dao.  This new website will be established as a serious platform to
promote the spreading of Dao and to grow a community of its users.

Links:
Home: http://www.daovm.net
Document: http//www.daovm.net/?page=document_en
Download: http//www.daovm.net/?page=download_en
Forum: http//www.daovm.net/?forum

Have fun.

Limin


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

Date: Fri, 6 Mar 2009 12:13:40 -0600
From: skip@pobox.com
To: Limin Fu <phoolimin@gmail.com>
Subject: Re: ANN: Dao, the official 1.0 version is released
Message-Id: <mailman.1349.1236363224.11746.python-list@python.org>


    Limin> This is to announce the first official release of Dao.

What's the connection to Python?

-- 
Skip Montanaro - skip@pobox.com - http://www.smontanaro.net/


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

Date: Fri, 06 Mar 2009 10:17:01 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: ANN: Dao, the official 1.0 version is released
Message-Id: <yMdsl.57934$aZ3.52706@newsfe01.iad>

Limin Fu wrote:

> Hi,
> 
> This is to announce the first official release of Dao.
> 
> Dao is a simple yet powerful object-oriented programming language

So, you pimp your language in news groups for other languages?  I see
your off topic post in 3 language groups I frequent, that's not the way
to get interest in your language.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 6 Mar 2009 11:27:55 -0800 (PST)
From: Limin Fu <phoolimin@gmail.com>
Subject: Re: ANN: Dao, the official 1.0 version is released
Message-Id: <78c833eb-d935-4a55-9839-d831a0506df1@q11g2000yqh.googlegroups.com>

Honest to say, there is no solid connection between Dao and Python.
It's just that I had received some good suggestions and comments from
these groups when I made a few previous announcements in these groups.
So I guessed somebody might be interested in Dao, and thought it might
be a good idea to announce it here again.

Nevertheless, Python is one of the few languages from which Dao tried
to learn something. I have paid a lot of my attention to Python during
the development of Dao. Once a time I even created a module trying to
allow calling Python functions and using python objects in Dao
scripts, it was a long time ago, probably even before this language is
named as Dao. Unfortunately I hadn't time to continue to develop that
module.


To Tim Greer and others:

Some people may think this kind of announcement are off topic in a
group for another language. This is not exactly true. This is still
about programming, there are so many programmers out there, who knows
if there would be somebody interested in a new language. This
announcement does not mean to threaten any language, I don't even
think it is somewhere close to that. So take it easy.



On 3=D4=C26=C8=D5, =CF=C2=CE=E77=CA=B113=B7=D6, s...@pobox.com wrote:
>     Limin> This is to announce the first official release of Dao.
>
> What's the connection to Python?
>
> --
> Skip Montanaro - s...@pobox.com -http://www.smontanaro.net/



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

Date: Fri, 06 Mar 2009 11:37:38 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: ANN: Dao, the official 1.0 version is released
Message-Id: <7Yesl.53201$Rg3.41464@newsfe17.iad>

Limin Fu wrote:

> To Tim Greer and others:
> 
> Some people may think this kind of announcement are off topic in a
> group for another language. This is not exactly true. This is still
> about programming, there are so many programmers out there, who knows
> if there would be somebody interested in a new language. This
> announcement does not mean to threaten any language, I don't even
> think it is somewhere close to that. So take it easy.

I don't see it as a threat at all (I'm not sure how you read that from
what I said), and I honestly don't care that much, but it seems pretty
odd to post about a completely different language in groups that have
no relation.  Imagine people posting announcements about languages,
modules, extensions, etc in other language groups as they happened,
we'd see 1/2 the group's posts containing that sort of information.

You posted in the Python, Perl and Ruby groups, and it just seemed (was)
inappropriate and not a good way to get people interested (it can be a
turn off to see what could be considered spam).  Just because it's
another language doesn't make it on topic.  There are over a hundred of
them out there, and even more derivatives and it's just not usually
appreciated (though I don't pretend to speak for anyone else, but it's
a pretty accurate observation).

I don't assume ill intent by you, but it was questionable about why.
Anyway, it's not a knock on the language, I just don't think the Perl,
Ruby or Python groups are relevant (but maybe some people will find it
interesting and be glad you did -- of course, that could be said of any
post about anything).
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 6 Mar 2009 16:03:07 -0600
From: skip@pobox.com
To: Limin Fu <phoolimin@gmail.com>
Subject: Re: ANN: Dao, the official 1.0 version is released
Message-Id: <mailman.1382.1236381307.11746.python-list@python.org>


    Limin> Honest to say, there is no solid connection between Dao and
    Limin> Python.  It's just that I had received some good suggestions and
    Limin> comments from these groups when I made a few previous
    Limin> announcements in these groups.  So I guessed somebody might be
    Limin> interested in Dao, and thought it might be a good idea to
    Limin> announce it here again.

Saying just that in your announcement would have been enough, in my opinion
to establish the connection.  It's just that there was no mention of Python
at all in your announcement.  So I asked.

-- 
Skip Montanaro - skip@pobox.com - http://www.smontanaro.net/


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

Date: Fri, 6 Mar 2009 05:29:52 -0800 (PST)
From: NovasTaylor <novastaylor@gmail.com>
Subject: Re: Find Windows Compression attribute?
Message-Id: <a7d0383f-049d-4021-ba64-711d71651c1b@e36g2000prg.googlegroups.com>

I have my answer, as provided over at perlmonks.org.

You can detect compression using GetAttributes but can not remove it
using SetAttributes.  To remove compression I am using the system
command:
   compact /u
and
   compact /u /i /s

I hope that helps someone out there, some day...

Cheers,

Tim


On Mar 5, 3:43=A0pm, NovasTaylor <novastay...@gmail.com> wrote:
> oh, and this also does not work:
>
> Win32::File::SetAttributes($path, $attr| COMPRESSED) or die "Can not
> set to COMPRESSED: $!";
>
> What am I missing?
>
> Tim



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

Date: Fri, 6 Mar 2009 06:34:19 -0800 (PST)
From: dn.perl@gmail.com
Subject: Re: Generating html page in UTF-8
Message-Id: <60ad1941-fca3-43b6-8e64-416a6eac4af6@k19g2000prh.googlegroups.com>

On Feb 17, 3:04 am, dn.p...@gmail.com wrote:
> I am using a myscript.cgi, written in Perl, to query an Oracle table,
> and display a few fields in a browser. One field is of the type LONG
> or CLOB, depending on which Oracle Server I am querying. If I run the
> "select myfield from mytable" command from a Windows Oracle client, I
> can see the field correctly. If I run the same command within 'sqlplus
> user/password' session within FreeBSD, the text of the CLOB field is
> not shown correctly.
>
> I think the problem is two-fold. I am now passing (hopefully) the
> correct ora_charset to DBI->connect ("db-details", "user",
> "password" , {ora_charset => correct_set}). But the browser still
> would not show the field correctly. I wonder whether I need to specify
> a parameter like 'ora_charset' to the 'encoding type' for the html
> page, and whether some library like 'use utf-8' is available which
> will help solve the issue. If there is any CLPerlM forum FAQ which
> addresses the issue, please do point me to it, and I shall be
> thankful.
>
> ------------------

I added the correct content-type header with charset=UTF-8. But that
wasn't enough. I was told I should add ora_charset parameter to
database-connect call.
my $dbh = DBI->connect("DBI:Oracle:{SID}", "{UID}", "{PWD}",
{ora_charset=>'AL32UTF8'}) || die "Could not connect to the database";

Even that wasn't enough.
Then I set env-variable NLS_LANG, and that did the trick.

#! /usr/local/bin/perl

$ENV{'NLS_LANG'}='AMERICAN_AMERICA.UTF8';
$ENV{'ORACLE_HOME'}='oracle-home';
$ENV{'TNS_ADMIN'}='tns-admin';

print "Content-type: text/html; charset=utf-8\n\n";

use DBI;

my $dbh = DBI->connect("DBI:Oracle:{SID}", "{UID}", "{PWD}",
{ora_charset=>'AL32UTF8'}) || die "Could not connect to the database";
$dbh->{LongReadLen} = 50000;
$dbh->{LongTruncOk} = 1;


However my code still isn't working smoothly. There is a database
field of the type CLOB. On the server I am using, my code works for
CLOB fields with length upto 1554 but fails for a CLOB field with
length=1568. I bumped up LONGREADLEN from 20,000 to 50000 but no luck.
sql_str = select nvl(lf.fld01, 'No Content') from mytable m, longfld
lf
    where m.longid = lf.longid ;
prepare, execute, etc etc ...
while (my @row = fetchrow_array ...)

This fetchrow_array call fails when CLOB field fld01 has length=1568,
and I get the error:
ORA-01406: fetched column value was truncated (DBD: ORA-01406 error on
field 1 of 1, ora_type 112 ....

Yet the same code works on another server for CLOB fields of length
1568 and above. A field of length 1946 was correctly read by the perl
script on that server.

My issue must be with system settings or env variables. What could be
going wrong here?

Eventually I want this cgi script to work as an FAQ Finder from a web
browser.

Thanks in advance.



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

Date: Fri, 6 Mar 2009 18:04:30 -0800 (PST)
From: grocery_stocker <cdalten@gmail.com>
Subject: How would I send the 'space bar command' in the following
Message-Id: <213d8b44-4dae-4757-8d28-1783884c898c@x38g2000yqj.googlegroups.com>

Given the following...

[cdalten@localhost oakland]$ more man.pl
#!/usr/bin/perl

use strict;
use warnings;

open my $out, '|-', 'man perl' or die "cannot open pipe to man
pages";

#print $out "find nope a=3Dcdalten\n";

close $out or die "cannot close pipe to man pages: $!";

[cdalten@localhost oakland]$ ./man.pl

I get....

PERL(1)                Perl Programmers Reference Guide
PERL(1)

NAME
       perl - Practical Extraction and Report Language

SYNOPSIS
       perl [ -sTtuUWX ]      [ -hv ] [ -V[:configvar] ]
            [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
            [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/
hexadecimal] ]
            [ -Idir ] [ -m[-]module ] [ -M[-]=92module...=92 ] [ -f ]
            [ -C [number/list] ]      [ -P ]      [ -S ]      [ -x
[dir] ]
            [ -i[extension] ]      [ -e =92command=92 ] [ -- ] [ program-
       file ] [ argument ]...

       If you=92re new to Perl, you should start with perlintro, which
is a gen-
       eral intro for beginners and provides some background to help
you navi-
       gate the rest of Perl=92s extensive documentation.

       For ease of access, the Perl manual has been split up into
several sec-
       tions.

       Overview

:

The problem is that the program just stops at ':'. Ie, I have to
physically press the space bar on my keyboard to get to the next page.
How would I set it up some the I could have the program do it for me?


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

Date: Fri, 06 Mar 2009 09:59:49 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: perl as email client
Message-Id: <qwdsl.114875$6r1.24416@newsfe19.iad>

Larry Gates wrote:

> 
> 
> I've used perl as a usenet client before, but now that I have a site
> out there with an email address that is supposed to get to me, and I
> wanted to look at it through the rubric of perl.
> 
> How would a person use perl to simulate what OE does?
> 
> What activestate modules are required for a given method?  I would
> have to think there would be as many ways to do this in perl as
> building a wall for a carpenter.

I believe you mean that you've used a usenet client coded in Perl. 
Someone asked a similar question a month or two ago, and then stated
they wanted to actually do something else in the end.  I assume you
mean exactly what your subject says, and that you want to use Perl to
code an email client?  I don't know of any, but it's certainly
possible.  I don't know where to suggest you start for Windows (using
ActiveState) though.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Fri, 6 Mar 2009 07:43:23 -0800 (PST)
From: tuser1@gmail.com
Subject: Re: Strange system() slowdown when using Inline::C
Message-Id: <c60a0592-f6de-4a5d-82c2-44e0fb66adce@41g2000yqf.googlegroups.com>

On Mar 6, 1:12=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth "A. Sinan Unur" <1...@llenroc.ude.invalid>:
>
> > I don't see that.
>
> > This is perl, v5.10.0 built for MSWin32-x86-multi-thread
> > (with 5 registered patches, see perl -V for more detail)
>
> Well, no. Since this is probably a problem with fork(2) of a large
> address space, and Win32 doesn't use fork(2), you wouldn't.

I have looked up perldoc -f system where it says:
"[...] Does exactly the same thing as exec LIST, except that a fork is
done first, and the parent process waits for the child process to
complete [...]"

I see that system() involves a fork, but a na=EFve question here: Why
does system() need to fork, can it not just simply run whatever needs
running (a shell program presumably) without forking and return to the
perl program to continue the program ? -- this would avoid the
unneccessary large address space.




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

Date: Sat, 07 Mar 2009 00:14:23 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Strange system() slowdown when using Inline::C
Message-Id: <rKWdnfhlleH9ISzUnZ2dnUVZ8jSWnZ2d@pipex.net>

tuser1@gmail.com wrote:
> 
> I see that system() involves a fork, but a naïve question here: Why
> does system() need to fork,

Because it needs another process to run the command in system (it actually does fork+exec).  The 
current process still needs to be there to pick up the story afterwards.


-- 
              Just because I've written it doesn't mean that
                   either you or I have to believe it.


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

Date: Sat, 7 Mar 2009 00:05:20 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Strange system() slowdown when using Inline::C
Message-Id: <0bq886-7f1.ln1@osiris.mauzo.dyndns.org>


Quoth tuser1@gmail.com:
> 
> I see that system() involves a fork, but a naïve question here: Why
> does system() need to fork, can it not just simply run whatever needs
> running (a shell program presumably) without forking and return to the
> perl program to continue the program ? -- this would avoid the
> unneccessary large address space.

Under traditional Unix systems there is no way to create a new process
without using fork(2).

Ben



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

Date: Sat, 7 Mar 2009 01:00:09 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Strange system() slowdown when using Inline::C
Message-Id: <pht886-js4.ln1@osiris.mauzo.dyndns.org>


Quoth rbg <ross.girshick@gmail.com>:
> 
> I can reproduce this issue ubuntu with perl 5.10.0 (and debian with
> perl 5.8.8), but *not* on OS X with perl 5.8.8.  It seems like it has
> something to do with how the perl interpreter is cloned when system()
> is called (seems that it isn't actually doing copy-on-write forking).
> Anyone have a deeper understanding of this issue?

Run

    perl -V:d_vfork

on each of these systems. I strongly suspect Mac OS X is using vfork,
which is more efficient for a fork almost immediately followed by an
exec, whereas Linux is not, but it would be interesting to confirm this.

On FreeBSD, with d_vfork='define', I get no noticable increase in
execution time with a large string, but if I replace the system with

    fork or exec "true";
    waitpid -1, 0;

I do.

Ben



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

Date: Fri, 6 Mar 2009 18:06:38 -0800 (PST)
From: rbg <ross.girshick@gmail.com>
Subject: Re: Strange system() slowdown when using Inline::C
Message-Id: <6d2f23e2-d24c-45b4-a67d-38a464548d3c@s20g2000yqh.googlegroups.com>

Ben -- right, you are.  On the OS X system I get d_vfork='define' and
on the linux systems I get d_vfork='undef'.  Is this a compile time
configuration option or is there a way to change it at runtime?

Thanks,
ross


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

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


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