pipe behavior different in perl 5 
Author Message
 pipe behavior different in perl 5

Is there any reason why OPENing pipes for input or output works
fine in perl 4.036 (on linux 1.0.8) but not in perl 5.0a6 (on
SunOS 5.3, whatever version of Solaris that is)?

Specifically, I'm trying to do something like this:

open FOO "| fgrep needle haystack";
or
open FOO "/usr/lib/sendmail -F \"me\" you |";

Like I said, these work fine in perl 4, and perl -cw in perl 5
does not complain about the syntax, but when I run the script
the output of the piped command goes to stderr (and is printed on
the screen) and the rest of the script is not executed. Plus I have
to press ^C to get back to a shell prompt.

Should I have perl 5 rebuilt on my system? If this is the problem,
any clues as to how I should avoid it in future?
Or is there some syntax change that I (and perl -cw) don't know about?

Dan
Bonus question: The version of travesty in _Programming Perl_ and in the
nutshell archives does not work. The error is: while: expression syntax.
Can anyone tell this lazy newbie how to make it work?

--

                        http://www.*-*-*.com/



Mon, 28 Apr 1997 07:24:32 GMT  
 pipe behavior different in perl 5

Quote:

>Is there any reason why OPENing pipes for input or output works
>fine in perl 4.036 (on linux 1.0.8) but not in perl 5.0a6 (on
>SunOS 5.3, whatever version of Solaris that is)?

>Specifically, I'm trying to do something like this:

>open FOO "| fgrep needle haystack";
>or
>open FOO "/usr/lib/sendmail -F \"me\" you |";

>Like I said, these work fine in perl 4, and perl -cw in perl 5
>does not complain about the syntax, but when I run the script
>the output of the piped command goes to stderr (and is printed on
>the screen) and the rest of the script is not executed. Plus I have
>to press ^C to get back to a shell prompt.

>Should I have perl 5 rebuilt on my system? If this is the problem,
>any clues as to how I should avoid it in future?
>Or is there some syntax change that I (and perl -cw) don't know about?

>Dan
>Bonus question: The version of travesty in _Programming Perl_ and in the
>nutshell archives does not work. The error is: while: expression syntax.
>Can anyone tell this lazy newbie how to make it work?

>--

>                        http://www.halcyon.com/dante/

--
The "usual disclaimers" apply.    | Meiko
Mike Stok                         | 130C Baker Ave. Ext

Meiko tel: (508) 371 0088 x124    |


Fri, 02 May 1997 04:17:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting Different Behavior from Perl Script and Unix Command

2. Different DEC/Sun behavior with euid/ruid

3. Same versions, different behavior

4. Linked Scripts w/ Different Behavior

5. Totally confused about array behavior in different unix shells

6. \Z regexp behavior different with $& in program

7. : Different behavior in and out of debugger

8. different behavior of %ENV (4.x vs 5.x)

9. Different browser behavior on '302 Redirect'

10. Different behavior of Tk:MsgBox under Win32 and Unix

11. errors on pipe open; strange eval behavior

12. Perl script to serve up different HTML pages at different times of day

 

 
Powered by phpBB® Forum Software