[30833] in Perl-Users-Digest
Perl-Users Digest, Issue: 2078 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 25 21:09:43 2008
Date: Thu, 25 Dec 2008 18:09:09 -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 Thu, 25 Dec 2008 Volume: 11 Number: 2078
Today's topics:
Re: Buffering problem with 'open' - ideas ? <uri@stemsystems.com>
Re: Buffering problem with 'open' - ideas ? <jurgenex@hotmail.com>
Re: FAQ 4.2 Why is int() broken? sln@netherlands.com
Re: Mathematica 7 compares to other languages w_a_x_man@yahoo.com
Re: Mathematica 7 compares to other languages <jon@ffconsultancy.com>
Re: Mathematica 7 compares to other languages sln@netherlands.com
Re: Non-OO interface to mysql <ced@blv-sam-01.ca.boeing.com>
Re: Press a button <pod69@gmx.net>
Re: Press a button <tim@burlyhost.com>
Re: Press a button <pod69@gmx.net>
Re: Understanding tempfile and open3 <ced@blv-sam-01.ca.boeing.com>
Re: Understanding tempfile and open3 <uri@stemsystems.com>
Re: Understanding tempfile and open3 sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Dec 2008 17:31:49 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Buffering problem with 'open' - ideas ?
Message-Id: <x7myej51ka.fsf@stemsystems.com>
>>>>> "AS" == Asim Suter <asuter@cisco.com> writes:
AS> "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
AS> news:jpd7l4hkd8ugiucvoknl3750g1hhqn06rk@4ax.com...
>> "Asim Suter" <asuter@cisco.com> wrote:
>>> I need to run a command in interactive fashion as well as catch its
>>> output.
>>
>> Are you trying to reinvent the Expect module?
>>
>> jue
AS> Expect is useful when its needed to 'feed' input to program in an
AS> automated fashion.
AS> That's not my intent. I still need the operation be human
AS> controlled on the shell. The human may choose yes or no.
so you can run expect on the subprocess and still have interaction with
the user. expect is the right solution if you want it simple. if you
need more control, then use an event loop with open2/3 on the process
and looking for input (maybe with Term::Readline) from the user.
if you just need to capture its output, you can also do that with the
script utility in the shell window.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Thu, 25 Dec 2008 16:18:07 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Buffering problem with 'open' - ideas ?
Message-Id: <9j88l4tfp4uddiki4trm9qm4b0gmn42fq6@4ax.com>
"Asim Suter" <asuter@cisco.com> wrote:
>
>"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
>news:jpd7l4hkd8ugiucvoknl3750g1hhqn06rk@4ax.com...
>> "Asim Suter" <asuter@cisco.com> wrote:
>>>I need to run a command in interactive fashion as well as catch its
>>>output.
>>
>> Are you trying to reinvent the Expect module?
>
>Expect is useful when its needed to 'feed' input to program in an automated
>fashion.
>That's not my intent. I still need the operation be human controlled on the
>shell. The human
>may choose yes or no.
What's blocking the Perl program from asking the human and then using
expect to feed the response to the other program?
jue
------------------------------
Date: Fri, 26 Dec 2008 00:25:50 GMT
From: sln@netherlands.com
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <ls88l4dsk1tkuk8m1h34859ojeqnf1dkhn@4ax.com>
On Thu, 25 Dec 2008 10:57:44 +0100, "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>On 2008-12-23 20:03, PerlFAQ Server <brian@stonehenge.com> wrote:
>> --------------------------------------------------------------------
>>
>> 4.2: Why is int() broken?
>>
>> Your "int()" is most probably working just fine. It's the numbers that
>> aren't quite what you think.
>>
>> First, see the answer to "Why am I getting long decimals (eg,
>> 19.9499999999999) instead of the numbers I should be getting (eg,
>> 19.95)?".
>>
>> For example, this
>>
>> print int(0.6/0.2-2), "\n";
> print int(0.6/0.2), "\n";
>>
>> will in most computers print 0, not 1, because even such simple numbers
> will in most computers print 2, not 3, because even such simple numbers
>
>(The extra subtraction is not necessary to demonstrate the problem and is
>distracting)
>
>
>> as 0.6 and 0.2 cannot be presented exactly by floating-point numbers.
> as 0.6 and 0.2 cannot be represented exactly by binary floating-point numbers.
>
>(0.6 and 0.2 can be represented exactly in decimal floating-point
>numbers. Or in base 5 or base 100, or any other base which is a multiple
>of 5. The problem isn't floating-point, it's binary. A binary fixed
>point representation would have the same problem.)
>
>> What you think in the above as 'three' is really more like
>> 2.9999999999999995559.
Indeed strange behavior. I noticed this strange behavior working on the ceil/floor
Perl equivalent. Take Note the below inconsistant behavior.
Here is some floor() code and output from Visual Studio 2005:
printf("====================\n\n");
printf( "The floor of -3.0 is %f\n\n", floor(-3.0) );
printf( "The floor of -4.0 is %f\n\n", floor(-4.0) );
printf( "The floor of -5.0 is %f\n\n", floor(-5.0) );
printf("\n\n");
for (double y=2.0; y<=3.25; y+=.25)
{
printf( "The floor of %f is %f\n", y, floor(y) );
printf( "The floor of -%f is %f\n\n", y, floor(-y) );
}
printf("*The floor of 0.3/0.1-2 is %f\n", floor(0.3/0.1-2) );
printf("The floor of 0.6/0.2-2 is %f\n", floor(0.6/0.2-2) );
printf("The floor of 0.9/0.3-2 is %f\n", floor(0.9/0.3-2) );
printf("The floor of 1.2/0.4-2 is %f\n", floor(1.2/0.4-2) );
printf("The floor of 1.5/0.5-2 is %f\n", floor(1.5/0.5-2) );
printf("The floor of 1.8/0.6-2 is %f\n", floor(1.8/0.6-2) );
printf("The floor of 2.1/0.7-2 is %f\n", floor(2.1/0.7-2) );
printf("The floor of 2.4/0.8-2 is %f\n", floor(2.4/0.8-2) );
printf("The floor of 2.7/0.9-2 is %f\n", floor(2.7/0.9-2) );
printf("\n");
for (double y=.1; y<=5.0; y+=.1)
{
double z = 3.0 * y;
printf( "The floor of %.1f/%.1f-2 is %f\n", z, y, floor(z/y-2) );
}
====================
The floor of -3.0 is -3.000000
The floor of -4.0 is -4.000000
The floor of -5.0 is -5.000000
The floor of 2.000000 is 2.000000
The floor of -2.000000 is -2.000000
The floor of 2.250000 is 2.000000
The floor of -2.250000 is -3.000000
The floor of 2.500000 is 2.000000
The floor of -2.500000 is -3.000000
The floor of 2.750000 is 2.000000
The floor of -2.750000 is -3.000000
The floor of 3.000000 is 3.000000
The floor of -3.000000 is -3.000000
The floor of 3.250000 is 3.000000
The floor of -3.250000 is -4.000000
*The floor of 0.3/0.1-2 is 0.000000
The floor of 0.6/0.2-2 is 0.000000
The floor of 0.9/0.3-2 is 1.000000
The floor of 1.2/0.4-2 is 0.000000
The floor of 1.5/0.5-2 is 1.000000
The floor of 1.8/0.6-2 is 1.000000
The floor of 2.1/0.7-2 is 1.000000
The floor of 2.4/0.8-2 is 0.000000
The floor of 2.7/0.9-2 is 1.000000
The floor of 0.3/0.1-2 is 1.000000
The floor of 0.6/0.2-2 is 1.000000
The floor of 0.9/0.3-2 is 1.000000
The floor of 1.2/0.4-2 is 1.000000
The floor of 1.5/0.5-2 is 1.000000
The floor of 1.8/0.6-2 is 1.000000
The floor of 2.1/0.7-2 is 0.000000
The floor of 2.4/0.8-2 is 1.000000
The floor of 2.7/0.9-2 is 1.000000
The floor of 3.0/1.0-2 is 1.000000
The floor of 3.3/1.1-2 is 1.000000
The floor of 3.6/1.2-2 is 1.000000
The floor of 3.9/1.3-2 is 1.000000
The floor of 4.2/1.4-2 is 1.000000
The floor of 4.5/1.5-2 is 1.000000
The floor of 4.8/1.6-2 is 1.000000
The floor of 5.1/1.7-2 is 1.000000
The floor of 5.4/1.8-2 is 1.000000
The floor of 5.7/1.9-2 is 1.000000
The floor of 6.0/2.0-2 is 1.000000
The floor of 6.3/2.1-2 is 1.000000
The floor of 6.6/2.2-2 is 1.000000
The floor of 6.9/2.3-2 is 1.000000
The floor of 7.2/2.4-2 is 1.000000
The floor of 7.5/2.5-2 is 1.000000
The floor of 7.8/2.6-2 is 1.000000
The floor of 8.1/2.7-2 is 1.000000
The floor of 8.4/2.8-2 is 1.000000
The floor of 8.7/2.9-2 is 0.000000
The floor of 9.0/3.0-2 is 1.000000
The floor of 9.3/3.1-2 is 1.000000
The floor of 9.6/3.2-2 is 1.000000
The floor of 9.9/3.3-2 is 1.000000
The floor of 10.2/3.4-2 is 1.000000
The floor of 10.5/3.5-2 is 1.000000
The floor of 10.8/3.6-2 is 1.000000
The floor of 11.1/3.7-2 is 0.000000
The floor of 11.4/3.8-2 is 1.000000
The floor of 11.7/3.9-2 is 1.000000
The floor of 12.0/4.0-2 is 1.000000
The floor of 12.3/4.1-2 is 1.000000
The floor of 12.6/4.2-2 is 1.000000
The floor of 12.9/4.3-2 is 1.000000
The floor of 13.2/4.4-2 is 1.000000
The floor of 13.5/4.5-2 is 1.000000
The floor of 13.8/4.6-2 is 1.000000
The floor of 14.1/4.7-2 is 1.000000
The floor of 14.4/4.8-2 is 1.000000
The floor of 14.7/4.9-2 is 1.000000
The floor of 15.0/5.0-2 is 1.000000
------------------------------
Date: Thu, 25 Dec 2008 13:12:31 -0800 (PST)
From: w_a_x_man@yahoo.com
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <c7cc6dc4-f807-4833-9397-7d590887602d@e1g2000pra.googlegroups.com>
On Dec 25, 5:24=A0am, Xah Lee <xah...@gmail.com> wrote:
> The JavaScript example:
>
> // Javascript. By William James
> function normalize( vec ) {
> var div=3DMath.sqrt(vec.map(function(x) x*x).reduce(function(a,b) a+b))
> =A0 return vec.map(function(x) x/div)
>
> }
>
> is also not qualified. (it is syntax error in SpiderMonkey engine
> =93JavaScript-C 1.7.0 2007-10-03=94)
Since you are using the latest version of Mathematica, you should
also use the latest version of SpiderMonkey.
The function works outside of a web browser with jslibs, and it
works in Firefox 3.0.1.
<html>
<body>
<script type=3D"application/javascript;version=3D1.8"/>
// Tested with Firefox 3.0.1.
// SpiderMonkey JavaScript 1.6 added map().
// 1.8 added reduce() and function shorthand:
// function(x) { return x * x }
// can now be:
// function(x) x * x
// Javascript. By William James
function normalize( vec ) {
var div=3DMath.sqrt(vec.map(function(x) x*x).reduce(function(a,b) a+b))
return vec.map(function(x) x/div)
}
window.alert( normalize( [2,3,4] ).toSource() )
</script>
</body>
</html>
------------------------------
Date: Thu, 25 Dec 2008 21:50:29 +0000
From: Jon Harrop <jon@ffconsultancy.com>
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <P5ednRHi8Zr6Ys7UnZ2dnUVZ8u-dnZ2d@posted.plusnet>
Xah Lee wrote:
>> >On Dec 10, 2:47 pm, John W Kennedy <jwke...@attglobal.net> wrote:
>> >> C:
>>
>> >> #include <stdlib.h>
>> >> #include <math.h>
>>
>> >> void normal(int dim, float* x, float* a) {
>> >> float sum = 0.0f;
>> >> int i;
>> >> float divisor;
>> >> for (i = 0; i < dim; ++i) sum += x[i] * x[i];
>> >> divisor = sqrt(sum);
>> >> for (i = 0; i < dim; ++i) a[i] = x[i]/divisor;
>>
>> >> }
>
> Due to the low level of C, this C example should perhaps then accept a
> sequence of numbers separated by space...
In other words, you want a REPL.
Why don't we have another challenge that involves handling a non-trivial
input format, i.e. parsing?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
------------------------------
Date: Fri, 26 Dec 2008 00:05:02 GMT
From: sln@netherlands.com
Subject: Re: Mathematica 7 compares to other languages
Message-Id: <8j78l4drqjg46ps74up555bfu44kct27f7@4ax.com>
On Thu, 25 Dec 2008 21:50:29 +0000, Jon Harrop <jon@ffconsultancy.com> wrote:
>Xah Lee wrote:
>>> >On Dec 10, 2:47 pm, John W Kennedy <jwke...@attglobal.net> wrote:
>>> >> C:
>>>
>>> >> #include <stdlib.h>
>>> >> #include <math.h>
>>>
>>> >> void normal(int dim, float* x, float* a) {
>>> >> float sum = 0.0f;
>>> >> int i;
>>> >> float divisor;
>>> >> for (i = 0; i < dim; ++i) sum += x[i] * x[i];
>>> >> divisor = sqrt(sum);
>>> >> for (i = 0; i < dim; ++i) a[i] = x[i]/divisor;
>>>
>>> >> }
>>
>> Due to the low level of C, this C example should perhaps then accept a
>> sequence of numbers separated by space...
>
>In other words, you want a REPL.
>
>Why don't we have another challenge that involves handling a non-trivial
>input format, i.e. parsing?
Maybe you could speed it up.
sln
----------------------------------
void normal (int Dimension, double *X, double *A)
{
double *xp, *ap, divisor, sum;
int i;
for ( i=0, sum=0., xp=X; i<Dimension; i++, xp++)
sum += (*xp) ** 2;
divisor = sqrt ( sum );
for ( i=0, ap=A, xp=X; i<Dimension; i++, ap++, xp++)
*ap = *xp / divisor;
// if Dimension is greater than
// sizeof double X[] or double A[] it will GPF.
// this is a really, really bad design.
}
------------------------------
Date: Thu, 25 Dec 2008 13:19:39 -0800 (PST)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Non-OO interface to mysql
Message-Id: <82258cc2-859c-4deb-81f6-10fedea20f73@w24g2000prd.googlegroups.com>
On Dec 25, 1:43 am, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> ....
> > Actually, I just assumed that expensive method pointer
> > lookups were being cached and that leveled the playing
> > field. Normally, that extra lookup would slow the OO
> > call and procedural would win.
>
> Well, the purpose of my test code was to find out how expensive these
> pointer lookups really are. A single pointer lookup would be completely
> insignificant compared to a normal perl subroutine call (which is
> already quite expensive). A hash lookup would be more expensive. If @ISA
> had to be searched (recursively) for each call, it would be even more
> expensive. My simple benchmark indicated that the overhead was very low
> (about 15ns per call), so I assumed it was only an extra pointer lookup
> or so. Your modification dramatically increased the overhead of the oo
> code (to about 285 ns per call). So my assumption was obviously wrong.
> What irritates me is that I don't see what could cause the difference.
>
> > Also, I assume that if the method argument is constant, as it is
> > here, the call result itself could be cached too
>
> No, this is not possible. Consider the call =ABrand(26)=BB in your code
> (rand is a builtin, but it could easily be implemented in Perl): The
> argument is a constant (26), but the return value changes every time.
> If perl would cache the return value the result wouldn't be very random,
> would it?
You're right that doesn't make sense generally although
I was thinking about the orig. sub foo() in the benchmark
code.
>
> > and that'd apply to the procedural call too.
>
> Right.
>
> In both the oo and the procedural case the compiler could determine that
> a function is "pure" (i.e., the result depends only on the arguments)
> and optimize accordingly. Perl doesn't afaik, with one important
> exception: A function with prototype () returning a constant is inlined.
>
It certainly appears though that Perl sneaks in some kind
of optimization. And, I would guess that, since foo() was
just trivially returning the exact arg that's passed, it's a
prime candidate for optimizing.. somewhere in op.c maybe...?
--
Charles DeRykus
------------------------------
Date: Thu, 25 Dec 2008 20:41:03 +0100
From: pod <pod69@gmx.net>
Subject: Re: Press a button
Message-Id: <4953e1d1$0$2633$91cee783@newsreader01.highway.telekom.at>
> Does that web interface require a login/active session to run the
> commands you pass to it (posting to that URL)?
NO - I have direct acess to the router http://10.0.0.138/
------------------------------
Date: Thu, 25 Dec 2008 13:06:04 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Press a button
Message-Id: <0BS4l.3447$Uk3.1371@newsfe10.iad>
pod wrote:
>
>> Does that web interface require a login/active session to run the
>> commands you pass to it (posting to that URL)?
> NO - I have direct acess to the router http://10.0.0.138/
Is it possible the direct access is due to your browser having an active
session, or does access simply not require a login at all?
Does the exact same URL, arguments and request method from your browser
itself result in a 403 error, or does it work then? In other words,
have you ruled out factors other than the script?
Do you need to pass the header, referer, etc.? Did you try this by
simply having the script post to the URL in question.
--
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: Thu, 25 Dec 2008 23:55:55 +0100
From: pod <pod69@gmx.net>
Subject: Re: Press a button
Message-Id: <49540f7e$0$2632$91cee783@newsreader01.highway.telekom.at>
> Is it possible the direct access is due to your browser having an active
> session, or does access simply not require a login at all?
No login is required and i never had to login myself - I can also acess
the router with telnet and I have to press for username and password
just ENTER then I am logged in.
> Does the exact same URL, arguments and request method from your browser
> itself result in a 403 error, or does it work then? In other words,
> have you ruled out factors other than the script?
In my browser I never had a 403 error
> Do you need to pass the header, referer, etc.?
I dont know?? This is my first experience with perl? You may have some
other code to test?
Did you try this by
> simply having the script post to the URL in question.
?? I dont know what you mean with that
------------------------------
Date: Thu, 25 Dec 2008 17:04:00 -0800 (PST)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Understanding tempfile and open3
Message-Id: <faa544c4-b3ab-4669-96af-163dbef4e02e@t26g2000prh.googlegroups.com>
On Dec 25, 7:06 am, use...@schweikhardt.net wrote:
> ...
> # What I want: write stdout to $filehandle and end up in $filename;
> # read stderr from <ERR>.
> open FH, ">$filename" or die "$!";
> my $pid = open3 (gensym, ">&FH", \*ERR, @cmd);
> while (<ERR>) {
> print $_ if /^\s\S+$/; # This works fine.
> # Do more things with $_.}
>
> waitpid ($pid, 0) or die "$!";
> close FH;
>
> system ('wc', $filename);
>
> Now the only ugly part here is that I seem unable to
> use $filehandle directly with open3 and ">&". Instead
> I go the detour via open FH, ">$filename". Hasn't
> tempfile() done something very similar (given me a
> handle and name)? Is there a way to make open3 accept
> some combination of ">&" and $filehandle without the
> FH detour? (I want tempfile for its race avoidance and
> autoremoval of temp file features).
I'm not sure why ">&$filehandle" doesn't work either. However, this
did work for me:
open3 (gensym, , '>&=' . fileno($filehandle) ,
'>&=' . fileno($error_fh),
@cmd ) ;
--
Charles DeRykus
------------------------------
Date: Thu, 25 Dec 2008 20:33:23 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Understanding tempfile and open3
Message-Id: <x7wsdn3el8.fsf@stemsystems.com>
>>>>> "u" == usenet <usenet@schweikhardt.net> writes:
u> On Dec 25, 3:34 am, Uri Guttman <u...@stemsystems.com> wrote:
>> your problem is in that line. open3 doesn't connect a process to file
>> handles that are open with files. it is meant to give you an open handle
>> to talk to the subprocess. once open3 is called you have to do all the
>> i/o afterwards - all it does is fork/exec the command while attaching
>> the handles (which are not pre-opened to anything) to the stdio/err of
>> the process.
u> Thanks Uri, for pointing me to this. In fact, open3 has a way
u> to use an existing file handle when it is prefixed with ">&".
u> This works as expected:
you are missing the core point. open3 doesn't do any I/O! a handle from
a process can only be used in one direction at a time. so you can take
an existing or new handle and connect it to a subprocess. that doesn't
make a 'pipe' of i/o between the process and the file. it just reuses
the existing handle and connects it to the process. you still need to
read stderr from the process and write it to the file.
u> Now the only ugly part here is that I seem unable to
u> use $filehandle directly with open3 and ">&". Instead
u> I go the detour via open FH, ">$filename". Hasn't
u> tempfile() done something very similar (given me a
u> handle and name)? Is there a way to make open3 accept
u> some combination of ">&" and $filehandle without the
u> FH detour? (I want tempfile for its race avoidance and
u> autoremoval of temp file features).
you can't do that. the handle from tempfile is for writing to it. the
handle for stderr is for reading from the process. how could one handle
be both?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Fri, 26 Dec 2008 01:35:49 GMT
From: sln@netherlands.com
Subject: Re: Understanding tempfile and open3
Message-Id: <g3d8l4tenb8fqdv8pd4t5ivqi6lo8pvin0@4ax.com>
On Thu, 25 Dec 2008 17:04:00 -0800 (PST), "C.DeRykus" <ced@blv-sam-01.ca.boeing.com> wrote:
>On Dec 25, 7:06 am, use...@schweikhardt.net wrote:
>> ...
>> # What I want: write stdout to $filehandle and end up in $filename;
>> # read stderr from <ERR>.
>> open FH, ">$filename" or die "$!";
>> my $pid = open3 (gensym, ">&FH", \*ERR, @cmd);
>> while (<ERR>) {
>> print $_ if /^\s\S+$/; # This works fine.
>> # Do more things with $_.}
>>
>> waitpid ($pid, 0) or die "$!";
>> close FH;
>>
>> system ('wc', $filename);
>>
>> Now the only ugly part here is that I seem unable to
>> use $filehandle directly with open3 and ">&". Instead
>> I go the detour via open FH, ">$filename". Hasn't
>> tempfile() done something very similar (given me a
>> handle and name)? Is there a way to make open3 accept
>> some combination of ">&" and $filehandle without the
>> FH detour? (I want tempfile for its race avoidance and
>> autoremoval of temp file features).
>
>I'm not sure why ">&$filehandle" doesn't work either. However, this
>did work for me:
>
>open3 (gensym, , '>&=' . fileno($filehandle) ,
> '>&=' . fileno($error_fh),
> @cmd ) ;
Hmm, interresting, was thinking of that, wondered if that did fdopen like.
Apparently, it does.
sln
------------------------------
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 2078
***************************************