[29935] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1178 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 8 16:09:42 2008

Date: Tue, 8 Jan 2008 13:09:10 -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, 8 Jan 2008     Volume: 11 Number: 1178

Today's topics:
    Re: "global watch-expressions" in perldb? <jl_post@hotmail.com>
    Re: Count differences between arrays <simon.chao@fmr.com>
        Easy way to create a Mac app bundle that runs a Perl sc amirkarger@gmail.com
    Re: Easy way to create a Mac app bundle that runs a Per <spamtrap@dot-app.org>
    Re: How would I create a Regular Expression to check <jurgenex@hotmail.com>
    Re: How would I create a Regular Expression to check <tzz@lifelogs.com>
        remove special characters in front of the file names wong_powah@yahoo.ca
    Re: remove special characters in front of the file name <jurgenex@hotmail.com>
    Re: remove special characters in front of the file name <someone@example.com>
    Re: remove special characters in front of the file name wong_powah@yahoo.ca
    Re: remove special characters in front of the file name wong_powah@yahoo.ca
    Re: remove special characters in front of the file name <simon.chao@fmr.com>
    Re: remove special characters in front of the file name <tzz@lifelogs.com>
        Segmentation Fault (core dumped) on Solaris 10 mariakvelasco@gmail.com
    Re: Segmentation Fault (core dumped) on Solaris 10 <simon.chao@fmr.com>
    Re: Segmentation Fault (core dumped) on Solaris 10 mariakvelasco@gmail.com
    Re: syswrite "Bad file descriptor" after successfully w <q2m3eft02@sneakemail.com>
    Re: syswrite "Bad file descriptor" after successfully w <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 8 Jan 2008 12:44:16 -0800 (PST)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: "global watch-expressions" in perldb?
Message-Id: <3f043024-d2c0-4e2c-b09f-9d3850b891b6@f47g2000hsd.googlegroups.com>

On Jan 3, 9:50 am, kj <so...@987jk.com.invalid> wrote:
>
> What *exactly* is a "global watch-expression" in the context of
> the perl debugger?  And what exactly needs to happen for a global
> watch-expression to stop the execution of the program?
>
> Of course, I tried to RTFM, but all it says is this:
>
>     w expr  Add a global watch-expression.  We hope you know
>             what one of these is, because they're supposed to
>             be obvious.


   For once, I kind of agree with Purl Gurl's rant.  For years, I
misunderstood what a watch-expression was because of this explanation,
and it wasn't until I was studying Ruby with the Ruby "Pickaxe" book
(that is, "Programming Ruby" by Dave Thomas) that I understood it by
reading the following:

   wat[ch] expr     Break when expression becomes true.

It even provides an example:

(rdb:1) watch n==1

With this watch-expression the debugger will break as soon as the
expression "n==1" evaluates to true (which is when n equals 1).

   In Perl, however, it seems like the debugger breaks whenever the
expression changes (and not necessarily when it becomes true).  So if
you have this script:

/usr/bin/perl
$n = 1;
$n = 2;
$n = 3;
$n = 4;
$n = 5;
$n = 6;
$n = 7;
__END__

and you run the debugger with:

   perl -d script.pl

and set a watch expression like this:

   DB<1> w $n == 3

then continue with the "c" command, you'll see it breaks AFTER having
set $n to 3 (because now "$n == 3" evaluates to true).  If you re-
continue (again with the "c" command), you'll break at the very next
line (after setting $n to 4), because now "$n == 3" evaluates to
false.

   If you continue again, you'll run to the end of the script, because
the expression "$n == 3" never changes.

   If you used this instead:

   DB<1> w $n

the debugger would break at every line because $n evaluates to
something different at every line.

   I hope this explanation helps.  Personally, I think it would be a
lot easier to just have written:

   w expr   Halts program execution whenever the value
            of the expression changes.

instead of writing "We hope you know what one of these is...".  The
first way is not only blatantly unhelpful, but also fosters
misconceptions if the programmer happens to thinks he/she understands
when in fact he/she really does not.

   Ironically, it was an explanation in a Ruby book that helped me
understand what the Perl documentation should have explained.  (And it
did it using less words, too, since it didn't bother explaining that
it should already be obvious.)

   -- Jean-Luc


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

Date: Tue, 8 Jan 2008 07:20:28 -0800 (PST)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: Count differences between arrays
Message-Id: <0045d663-9c2e-4d1f-8028-5bdbc748dcee@l6g2000prm.googlegroups.com>

On Jan 8, 4:42=A0am, Steve <st...@mixmin.net> wrote:
> On Mon, 7 Jan 2008 11:27:00 -0800 (PST), nolo contendere wrote in
> Message-Id: <f1b66651-dcb9-4ab3-9b61-5f2a5b2a8f76@s19g2000prg.googlegroups=
 .com>:
>
> > Will the hash from array2 need to be constructed anew each time you
> > filter? Can you parallelize the work across all the NNTP messages, and
> > use a shared hash (or a reasonable facsimile) to perform the lookups?
>
> The hash will be constructed new for each message processed, as are the
> arrays for Newsgroups and Followup-To: content. =A0For both arrays there
> are unlikely to be more than 10 elements.
>

What's the purpose of reconstructing the hash each time? Just do it
once in the beginning, if it won't change. Also, if it's static, you
can use it without reservation in parallel processing.


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

Date: Tue, 8 Jan 2008 09:50:24 -0800 (PST)
From: amirkarger@gmail.com
Subject: Easy way to create a Mac app bundle that runs a Perl script?
Message-Id: <2ddc37ab-db13-4d2a-aa13-0c81a4bea98d@i3g2000hsf.googlegroups.com>

I've got a Perl script that I'd like to turn into a Mac app, such that
you can double-click it and it will run.  I've learned (just barely)
enough AppleScript to tell Terminal to do script. But if I need to do
this for a bunch of Perl scripts, it could get tedious with the
ScriptEditor.

I think Platypus doesn't quite do what I want, since my script needs
to do IO, and patypus will only let you do O.

I would like to have a script where you say

    perl make_app_bundle.pl -name myapp -perl perl_script.pl -
applescript applescript.scpt

which will:

- make myapp.app directory
- make Info.plist and other needed stuff
- put applescript.scpt in Contents/Resources/Scripts (right?)
- put perl_script.pl in Contents/Resources (or something)
- do other mystical things that Mac apps require

It seems like a sort of "make dist" functionality, I guess.

Does something like this exist? Is there somewhere else I should be
asking this?

Thanks,
-Amir Karger


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

Date: Tue, 08 Jan 2008 15:15:49 -0500
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Easy way to create a Mac app bundle that runs a Perl script?
Message-Id: <m1r6gsrs3u.fsf@dot-app.org>

amirkarger@gmail.com writes:

> I've got a Perl script that I'd like to turn into a Mac app, such that
> you can double-click it and it will run.  I've learned (just barely)
> enough AppleScript to tell Terminal to do script. But if I need to do
> this for a bunch of Perl scripts, it could get tedious with the
> ScriptEditor.
>
> I think Platypus doesn't quite do what I want, since my script needs
> to do IO, and patypus will only let you do O.
>
> I would like to have a script where you say
>
>     perl make_app_bundle.pl -name myapp -perl perl_script.pl -
> applescript applescript.scpt
>
> which will:
>
> - make myapp.app directory
> - make Info.plist and other needed stuff
> - put applescript.scpt in Contents/Resources/Scripts (right?)
> - put perl_script.pl in Contents/Resources (or something)
> - do other mystical things that Mac apps require
>
> It seems like a sort of "make dist" functionality, I guess.
>
> Does something like this exist?

CamelBones. <http://camelbones.sourceforge.net>

It uses Xcode for building the .app though, and Interface Builder for the
GUI elements. When in Rome, do as the Romans do...

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Tue, 08 Jan 2008 12:50:52 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How would I create a Regular Expression to check
Message-Id: <jrr6o31nuorhudv9farolk0qkcak92lm6p@4ax.com>

[Please do not top-post, trying to correct]
Nathan <nathan.stanford@gmail.com> wrote:
>> On Jan 3, 10:17 am, Nathan <nathan.stanf...@gmail.com> wrote:
>> > How would I create a Regular Expression to check Street address for
>> > any of the below items:
>>
>> > If the first character is a P ...
>> > p.o. box
>> > po box
>> > po. box
>> > p.o box
>> > post office box
>> > POB
>> > POX
>> > PODRAWER
>> > POSTOFFICE
>> > PO BX
>> > POBOX
>> > P/O
>>
>> > If the first character is a B ...
>> > BX
>> > BOX
>> > Buzon      -- (Means 'Box' in Spanish)
>>
>> > If the first character is a A ...
>> > Apartado   -- (is 'PO Box in Spanish)
>> > Aptdo      -- (is POB abbreviated in Spanish)
>Here is what I came up with but I like yours better I might try yours
>instead of mine....
>
>^([Pp]([Oo][Ss][Tt])?[.\s]*[Oo]([Ff][Ff][Ii][Cc][Ee])?[.\s]*[Bb][Oo]
>[Xx])|[Pp][Oo]([Bb]|[Xx]|[Dd][Rr][Aa][Ww][Ee][Rr]|[Ss][Tt][Oo][Ff][Ff]
>[Ii][Cc][Ee]|[ ][Bb][Xx]|[Bb][Oo][Xx])|[Pp][/][Oo]|[Bb]([Xx]|[Oo][Xx]|
>[Uu][Zz][Oo][Nn])|[Aa]([Pp][Aa][Rr][Tt][Aa][Dd][Oo]|[Pp][Tt][Dd][Oo])

Sorry, but that's a great example for what not to do. Absolutely
unmaintainable. Within 4 weeks you will have no idea what that RE does and
how to modify it if you need to add another term.

IMO regular expressions are the wrong tool for the job. Far better would be
to put those terms in a hash (as keys), then extract the street name from
your address, and simply check if this street name exists() in the hash.
Or put the terms in an array and just loop through them. 

Maybe that's not as smart as an RE approach, but it's much more intelligent.

jue


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

Date: Tue, 08 Jan 2008 11:21:04 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How would I create a Regular Expression to check
Message-Id: <86sl18kzcv.fsf@lifelogs.com>

On Mon, 7 Jan 2008 13:28:00 -0800 (PST) Nathan <nathan.stanford@gmail.com> wrote: 

N> You did not do my homework but thanks... I will try yours as well...
N> Here is what I came up with but I like yours better I might try yours
N> instead of mine....

N> ^([Pp]([Oo][Ss][Tt])?[.\s]*[Oo]([Ff][Ff][Ii][Cc][Ee])?[.\s]*[Bb][Oo]
N> [Xx])|[Pp][Oo]([Bb]|[Xx]|[Dd][Rr][Aa][Ww][Ee][Rr]|[Ss][Tt][Oo][Ff][Ff]
N> [Ii][Cc][Ee]|[ ][Bb][Xx]|[Bb][Oo][Xx])|[Pp][/][Oo]|[Bb]([Xx]|[Oo][Xx]|
N> [Uu][Zz][Oo][Nn])|[Aa]([Pp][Aa][Rr][Tt][Aa][Dd][Oo]|[Pp][Tt][Dd][Oo])

Good god, doesn't this bother you even a little bit?  You should at
least submit it to the Daily WTF.

Ted


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

Date: Tue, 8 Jan 2008 11:07:51 -0800 (PST)
From: wong_powah@yahoo.ca
Subject: remove special characters in front of the file names
Message-Id: <3838e69a-fbb7-4f02-b05c-06d654e28040@y5g2000hsf.googlegroups.com>

I want to remove all special characters in front of a list of file
names (which may be generated by the "find" or other commands).
How to do that?
This does not work:
$ find . -type f -print |  perl -pe 's/([?|*.\'"])/\\$1/g'
>
$ find . -type f -print |  perl -pe "s/([?|*.\'"])/\\$1/g"
bash: syntax error near unexpected token `)'


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

Date: Tue, 08 Jan 2008 19:58:48 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: remove special characters in front of the file names
Message-Id: <i9l7o3lpq01psjrgebfq1ghpgtl5bkt5d0@4ax.com>

wong_powah@yahoo.ca wrote:
>I want to remove all special characters in front of a list of file
>names (which may be generated by the "find" or other commands).
>How to do that?
>This does not work:

Unfortunately you forgot to tell in which way the expected behaviour is
different from the observed behaviour, i.e. WHAT IS THE PROBLEM?
 
>$ find . -type f -print |  perl -pe 's/([?|*.\'"])/\\$1/g'

So I can only guess that this s/// does additional unwanted substitutions in
the middle of the text. This is because you forgot to anchor the RE to the
beginning of the string.

jue


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

Date: Tue, 08 Jan 2008 20:01:38 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: remove special characters in front of the file names
Message-Id: <CEQgj.6564$fj2.5125@edtnps82>

wong_powah@yahoo.ca wrote:
> I want to remove all special characters in front of a list of file
> names (which may be generated by the "find" or other commands).
> How to do that?
> This does not work:
> $ find . -type f -print |  perl -pe 's/([?|*.\'"])/\\$1/g'
> $ find . -type f -print |  perl -pe "s/([?|*.\'"])/\\$1/g"
> bash: syntax error near unexpected token `)'

find . -type f -print |  perl -pe 's/([?|*.\047"])/\\$1/g'



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Tue, 8 Jan 2008 12:12:43 -0800 (PST)
From: wong_powah@yahoo.ca
Subject: Re: remove special characters in front of the file names
Message-Id: <dc3c4bf1-bf20-4553-b924-45563819335c@v4g2000hsf.googlegroups.com>

On Jan 8, 2:58 pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> wong_po...@yahoo.ca wrote:
> >I want to remove all special characters in front of a list of file
> >names (which may be generated by the "find" or other commands).
> >How to do that?
> >This does not work:
>
> Unfortunately you forgot to tell in which way the expected behaviour is
> different from the observed behaviour, i.e. WHAT IS THE PROBLEM?
>
> >$ find . -type f -print |  perl -pe 's/([?|*.\'"])/\\$1/g'
>
> So I can only guess that this s/// does additional unwanted substitutions =
in
> the middle of the text. This is because you forgot to anchor the RE to the=

> beginning of the string.
>
> jue

The problem is that a '>' appear for
$ find . -type f -print |  perl -pe 's/([?|*.\'"])/\\$1/g'
>

Sorry, I don't understand the meaning of "to anchor the RE to the
beginning of the string."

Do you mean:
$ find . -type f -print |  perl -pe 's/^([?|*.\'"])/\\$1/g'
>
$ find . -type f -print |  perl -pe "s/^([?|*.\'"])/\\$1/g"
bash: syntax error near unexpected token `)'

Both does not work:(.



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

Date: Tue, 8 Jan 2008 12:18:08 -0800 (PST)
From: wong_powah@yahoo.ca
Subject: Re: remove special characters in front of the file names
Message-Id: <d0845ef0-d516-4351-8ce0-d3593148f095@m77g2000hsc.googlegroups.com>

e.g. for this output:
$ find . -type f -print
 ./VERSION
 ./RELEASE

My desired output will be:
VERSION
RELEASE

This does not work:
$ find . -type f -print |  perl -pe 's/([?|*.\047"])/$1/g'
 ./VERSION
 ./RELEASE



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

Date: Tue, 8 Jan 2008 12:22:41 -0800 (PST)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: remove special characters in front of the file names
Message-Id: <f40eeaed-89f2-425b-9246-20ca0b1a3e7a@q39g2000hsf.googlegroups.com>

On Jan 8, 3:18=A0pm, wong_po...@yahoo.ca wrote:
> e.g. for this output:
> $ find . -type f -print
> ./VERSION
> ./RELEASE
>
> My desired output will be:
> VERSION
> RELEASE
>
> This does not work:
> $ find . -type f -print | =A0perl -pe 's/([?|*.\047"])/$1/g'
> ./VERSION
> ./RELEASE


try:

find . -type f -print | perl -pe 's/^\W+//'



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

Date: Tue, 08 Jan 2008 14:26:23 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: remove special characters in front of the file names
Message-Id: <86k5mkkqs0.fsf@lifelogs.com>

On Tue, 8 Jan 2008 12:18:08 -0800 (PST) wong_powah@yahoo.ca wrote: 

wp> e.g. for this output:
wp> $ find . -type f -print
wp> ./VERSION
wp> ./RELEASE

wp> My desired output will be:
wp> VERSION
wp> RELEASE

wp> This does not work:
wp> $ find . -type f -print |  perl -pe 's/([?|*.\047"])/$1/g'
wp> ./VERSION
wp> ./RELEASE

You mean you want the base name?  This will do what you're asking in the
example above (you don't need Perl necessarily):

find . -type f -exec basename {} \;

Are you trying to do something else?  Show some more examples (what you
had above was great, by the way).

Ted


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

Date: Tue, 8 Jan 2008 07:15:12 -0800 (PST)
From: mariakvelasco@gmail.com
Subject: Segmentation Fault (core dumped) on Solaris 10
Message-Id: <a093b794-3d40-44dd-b7c0-0ccd5506a821@e23g2000prf.googlegroups.com>

Hello,

I am trying to run a perl script on a Solaris 10 machine, which is
suppose to display a dialog box and I keep getting a Segmentation
Fault (core dumped) error.  I don't get this error message when I run
it on Windows or Linux.  Does anyone have an idea on where I should
look for the root of the problem.

Any advice would be great.

Thanks!


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

Date: Tue, 8 Jan 2008 07:25:14 -0800 (PST)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: Segmentation Fault (core dumped) on Solaris 10
Message-Id: <d1a7ebca-3981-49cd-b1b8-4dbce732d864@y5g2000hsf.googlegroups.com>

On Jan 8, 10:15=A0am, mariakvela...@gmail.com wrote:
> Hello,
>
> I am trying to run a perl script on a Solaris 10 machine, which is
> suppose to display a dialog box and I keep getting a Segmentation
> Fault (core dumped) error. =A0I don't get this error message when I run
> it on Windows or Linux. =A0Does anyone have an idea on where I should
> look for the root of the problem.
>
> Any advice would be great.

Post the script (if it's small), or a small example script which
demonstrates the problem. The output of perl -V could also help us
diagnose the problem.


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

Date: Tue, 8 Jan 2008 08:30:54 -0800 (PST)
From: mariakvelasco@gmail.com
Subject: Re: Segmentation Fault (core dumped) on Solaris 10
Message-Id: <4806d3b2-1a0f-43fc-a8cb-05e02c787179@1g2000hsl.googlegroups.com>

On Jan 8, 7:25=A0am, nolo contendere <simon.c...@fmr.com> wrote:
> On Jan 8, 10:15=A0am, mariakvela...@gmail.com wrote:
>
> > Hello,
>
> > I am trying to run a perl script on a Solaris 10 machine, which is
> > suppose to display a dialog box and I keep getting a Segmentation
> > Fault (core dumped) error. =A0I don't get this error message when I run
> > it on Windows or Linux. =A0Does anyone have an idea on where I should
> > look for the root of the problem.
>
> > Any advice would be great.
>
> Post the script (if it's small), or a small example script which
> demonstrates the problem. The output of perl -V could also help us
> diagnose the problem.


This is what perl -V returns

Summary of my perl5 (revision 5.0 version 6 subversion 1)
configuration:
  Platform:
    osname=3Dsolaris, osvers=3D2.7, archname=3Dsun4-solaris
    uname=3D'sunos dewitt.vnet.net 5.7 generic_patch sun4u sparc '
    config_args=3D'-Dcc=3Dgcc -de'
    hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine
    usethreads=3Dundef use5005threads=3Dundef useithreads=3Dundef
usemultiplicity=3Dundef
    useperlio=3Dundef d_sfio=3Dundef uselargefiles=3Ddefine usesocks=3Dundef=

    use64bitint=3Dundef use64bitall=3Dundef uselongdouble=3Dundef
  Compiler:
    cc=3D'gcc', ccflags =3D'-fno-strict-aliasing -I/usr/local/include -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64',
    optimize=3D'-O',
    cppflags=3D'-fno-strict-aliasing -I/usr/local/include'
    ccversion=3D'', gccversion=3D'2.95.3 20010315 (release)',
gccosandvers=3D'solaris2.7'
    intsize=3D4, longsize=3D4, ptrsize=3D4, doublesize=3D8, byteorder=3D4321=

    d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine,
longdblsize=3D16
    ivtype=3D'long', ivsize=3D4, nvtype=3D'double', nvsize=3D8, Off_t=3D'off=
_t',
lseeksize=3D8
    alignbytes=3D8, usemymalloc=3Dy, prototype=3Ddefine
  Linker and Libraries:
    ld=3D'gcc', ldflags =3D' -L/usr/local/lib '
    libpth=3D/usr/local/lib /usr/lib /usr/ccs/lib
    libs=3D-lsocket -lnsl -lgdbm -ldl -lm -lc
    perllibs=3D-lsocket -lnsl -ldl -lm -lc
    libc=3D/lib/libc.so, so=3Dso, useshrplib=3Dfalse, libperl=3Dlibperl.a
  Dynamic Linking:
    dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, ccdlflags=3D' '
    cccdlflags=3D'-fPIC', lddlflags=3D'-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Apr 26 2001 16:17:32
  @INC:
    /usr/local/lib/perl5/5.6.1/sun4-solaris
    /usr/local/lib/perl5/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl


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

Date: Tue, 8 Jan 2008 06:24:49 -0800 (PST)
From: Robert Jacobson <q2m3eft02@sneakemail.com>
Subject: Re: syswrite "Bad file descriptor" after successfully writing to that  file handle
Message-Id: <e8b353f5-2d92-415d-b19c-63e98a2666bf@c4g2000hsg.googlegroups.com>

On Jan 7, 10:31 am, Robert Jacobson <q2m3ef...@sneakemail.com> wrote:

> - if X time elapsed:
>    - close file
>    - new thread for &convert_file().  I call $thread->detach

I think I have fixed the problem, though I still don't know why it was
occurring.

In convert_file(), I was using a system() call to start an external
perl script.  I basically copied the perl code from that external
script into convert_file(), and the problem seems to have gone away.
At least, I didn't have any problems in the past 16 hours or so.

If anyone can tell me -- is using system() inside a thread "bad" for
some reason?  If so, why?



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

Date: Tue, 8 Jan 2008 17:00:50 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: syswrite "Bad file descriptor" after successfully writing to that  file handle
Message-Id: <2rmc55-dg1.ln1@osiris.mauzo.dyndns.org>


Quoth Robert Jacobson <q2m3eft02@sneakemail.com>:
> On Jan 7, 10:31 am, Robert Jacobson <q2m3ef...@sneakemail.com> wrote:
> 
> > - if X time elapsed:
> >    - close file
> >    - new thread for &convert_file().  I call $thread->detach
> 
> I think I have fixed the problem, though I still don't know why it was
> occurring.
> 
> In convert_file(), I was using a system() call to start an external
> perl script.  I basically copied the perl code from that external
> script into convert_file(), and the problem seems to have gone away.
> At least, I didn't have any problems in the past 16 hours or so.
> 
> If anyone can tell me -- is using system() inside a thread "bad" for
> some reason?  If so, why?

Likely some interaction between system and threads and pseudo-fork. Can
you post a *minimal* example that reproduces the problem, including your
versions of perl, threads and threads::shared? Have you tried upgrading
to the latest threads?

Ben



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

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


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